Quantcast
Channel: Windows PowerShell forum
Viewing all 21975 articles
Browse latest View live

Import IIS configuration csv for Add-WindowsFeature with alternate Source on Win2012r2

$
0
0

I've been given an export csv of a webserver IIS configuration to apply to a new server. I've mounted the win2012r2 installation material to E:\sources\sxs. 

Running 

Import-CSV C:\TEMP\OldServerWebfeatures.csv  | foreach{Add-WindowsFeature $_.name -Whatif}

Getting

WARNING: Files for some of the features are not available on the target server. You may need to specify an alternate s
ource path for missing feature files by adding the -Source parameter. If a path is not specified, by default, the comm
and attempts to use a Group Policy setting or Windows Update to find the files.

I'm not seeing -source as an available parameter.

Suggestions appreciated. Thanks.


Try Catch - Unexpected behaviour

$
0
0

Hi

I have a script with an unexpectd behaviour when inside a try-catch block

The $ErrorActionPreference is Continue
The script does Get-ADUser xyz  -ErrorAction SilentlyContinue
When no try-catch block is used, the script continues to next statements
When the Get-ADUser xyz  -ErrorAction SilentlyContinue is used inside a try-catch block, the script jumps to the catch block (Cannot find an object with identity: 'xyz' under: xxx).

Shouldn´t the -ErrorAction specified allow me to continue and have the try-catch take effect only to other errors on other commands inside the block?

Thanks,

JD

delete group that contains a special name

$
0
0

Hi

im trying to delete Groups that contain special names. What im trying to do is to check first if there are such Groups and then pipe the deletion into the get-adgroup. If there are no Groups found it exit (i dont want the script to go through the deletion part). I cant get the foreach loop to be piped after get-adgroup. any help will be appreciated.

#Remove Active Directory groups
$Server = "SERVER01"

$X = Adminitrator_' + $Server + '*'
try 
    {
        Get-ADGroup -Filter {Name -like $X} | Select-Object Name -ErrorAction Stop | foreach ($ADGroup in $ADGroups)
        {
            Write-Host $ADGroup.Name
            #Remove-ADGroup -Identity $ADGroup.Name
        }
    }
catch
    {"the following error appeared: `"$($_.Exception.Message)`""
    }

Help uninstalling WIN32 app by name from members of a security group

$
0
0

I am new to powershell (on a daily basis)  I am having some trouble trying to create a script that is a bit more efficient than running a command pc by pc over and over.  I have a group of pcs which have a specific version of an application that need to have the current version uninstalled in order to upgrade to the newest version. Someone please help.  I cannot find and example of this usage anywhere Here is what I have so far:

PS C:\WINDOWS\system32> $member = Get-ADGroupMember -identity "MySecurityGroupName" -Recursive 

$MyApp = Get-WmiObject -Class Win32_Product -ComputerName $member.Name | Where-Object{$_.Name -eq "Name of app to uninstall"}

$MyApp.uninstall()


jesse holden

get-childitem cannot find drive-letter

$
0
0

Hello

i am using a short script to move folders older then 120 of days.

First, i use the line:

Enter-PSSession servername

To connect from the machine scheduling all scripts, to the application server where the job should run.

Then i use this line to compare dates on the folder:
$FoldersToMove = get-childitem $sourcefolder | where {$_.PSIsContainer} | where {$_.LastWriteTime -lt $modifieddate}

But then i get:

get-childitem : Cannot find drive. A drive with the name 'D' does not exist.
At \\timmlmapp006\c$\Teiswork\AD\MoveOldDirectoriesUbwE-InvoiceArchive.ps1:10 char:20
+   $FoldersToMove = get-childitem $sourcefolder | where {$_.PSIsContai ...
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:String) [Get-ChildItem], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Running the same script, logged in on the application server works.

Why does not "get-childitem" se the driveletter?

Help is greatly appreciated.

when calling a script inside a script, tables are not shown

$
0
0

Hi,

i´m trying to make a graphical toolbox for my own and/or downloaded scripts.

In this part i call another script named "Speicherabfrage.ps1". (Downloaded script to read RAM Informations)

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") 
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") 

$objForm = New-Object System.Windows.Forms.Form

...

#Raminfo_PS
$Raminfo_PS = New-Object System.Windows.Forms.Button
$Raminfo_PS.Location = New-Object System.Drawing.Size(100,180)
$Raminfo_PS.Size = New-Object System.Drawing.Size(80,23)
$Raminfo_PS.Text = "Raminfo_PS"
$Raminfo_PS.Name = "Raminfo_PS"
$Raminfo_PS.Add_Click({
    .\Speicherabfrage.ps1
})
$objForm.Controls.Add($Raminfo_PS)

...

[void] $objForm.ShowDialog()

the called script start like this:

[Cmdletbinding()]Param([string]$Computername="localhost")cls$PysicalMemory=Get-WmiObject-class"win32_physicalmemory"-namespace"root\CIMV2"-ComputerName$Computername Write-Host"Memory Modules:"-ForegroundColor Green$PysicalMemory|Format-Table Tag,BankLabel,@{n="Capacity(GB)";e={$_.Capacity/1GB}},Manufacturer,PartNumber,Speed -AutoSize Write-Host"Total Memory:"-ForegroundColor GreenWrite-Host"$((($PysicalMemory).Capacity | Measure-Object -Sum).Sum/1GB)GB"

...

the complete script is postet correctly except the table and no errors are displayed. Do i have to convert the table? Should i call the script in another way? Any Ideas why tables are not shown?


Change name of new files

$
0
0

Hello,



I need to make script who change name of new files.

I have folder where I make files and I want add to this files _date.

For example:

Today I make files:

file1,file2,file3

Script must rename this files and add to it date: file1_02062020,file2_02062020,file3_02062020

Next day I make new files: file1,file2,file3 and script renames it for: file1_03062020,file2_03062020,file3_03062020

And more at other day.

Convert items LastWriteTime to JSON (Round-trip date/time pattern)

$
0
0

Hello,

can you please help me convert LastWriteTime to "Round-trip date/time pattern" format?

for example

Get-Date -format o 

will return like this 

"2014-07-02T12:50:49.3494995+04:00"

 if I try convert with

Get-date | Convertto-Json

I`ll get like this:

"\/Date(1411846057456)\/" 

Elasticsearch does not recognize this format as "Date" tape  and perceives as a string tape.

My question:

How can I convert LastWriteTime "Friday, May 29, 2020 12:00:00 AM"  object attribute to this one "2020-05-12T12:00:00.3494995+04:00" ?

Thank you.


Unable to fetch data from azure vm

$
0
0

Hi Support,

I have 50 azure window and linux vm and i am looking power shell script to fetch data like what service in running inside vm or i want to any particular service in running in vm or not

Exporting an array to csv

$
0
0
            

I have created the script below and the values are being added into the CSV, but they are being duplicated on each line/column, example below.

RTC_Status                RTME_Version             UserName
Connected,Connected 2.6.0.2030,2.6.0.2030 domain\user1,domain\user2
Connected,Connected 2.6.0.2030,2.6.0.2030 domain\user1,domain\user2

$Array =@()## Create Array to hold the Data
$Computers =Get-Content-Path C:\Users\username\Downloads\Computernames.txtforeach($Computer in $Computers){
    $Result =""|Select RTC_Status,RTME_Version,UserName
    $OS =Get-WMIObject-ComputerName $Computers -Namespace ROOT\Citrix\hdx\RTOptPack-ClassCitrix_HDXRTConnector
    $username =Get-WmiObject-ComputerName $Computers ClassWin32_ComputerSystem

    
    $Result.RTC_Status = $OS.RTC_Status -join ','
    $Result.RTME_Version = $OS.RTME_Version -join ','
    $Result.UserName= $username.UserName-join ','
    $Array += $Result ## Add the data to the array}

$Array |Export-Csv C:\Users\username\Downloads\file.csv -NoTypeInformation

Get-ADComputer need help

$
0
0

I have this script where $PC gives empty output. How can i fix it? ( I did try the Asset# 0123456 in place of $Asset and it works, i want to get it working using the $Asset)

PS C:\ps> $Asset = "0123456"

PS C:\ps> $Asset
0123456

PS C:\ps> $PC = Get-ADComputer -Filter 'Name -like "*$Asset*"' | select-object Name

PS C:\ps> $PC


Combining OneDrive URLs based on SamAccountName

$
0
0

Hello,

I'm migrating user home drives to OneDrive. I'm using the Sharepoint Migration Tool for the migration. Our users homedrives go off there samaccountname. Right now I have two separate files. One with all the OneDrive URL's for every user and another with the samaccountnames. Is there a powershell cmd that would be able to match the account names with the proper OneDrive URL or vice versa instead of me going through this manually? 

saving XML file changes text case of UTF-8 to lowercase

$
0
0

I noticed when needing to change the encoding to UTF with no BOM the UTF-8 is saved to lower case.  

I found a work-around by using the $xml.outerxml  then saving that string.  but this seems odd that that the case would be overwritten.  I could see if it weren't there. 

A small code snip example below to show the issue. 

$xml = [xml]@"<?xml version="1.0" encoding="UTF-8"?><test><example>required</example>.</test>"@
#$xml.Save('c:\temp\lower.xml')

$utf8WithoutBom = New-Object System.Text.UTF8Encoding($false)

$settings = New-Object System.Xml.XmlWriterSettings
$settings.Encoding = $utf8WithoutBom
$settings.CheckCharacters = $false
$sw = [System.Xml.XmlWriter]::Create( 'c:\temp\lower.xml',$settings )

#New-Object System.IO.StreamWriter($newFileName, $false, $utf8WithoutBom)
$xml.Save($sw)
$sw.Close()

#uncommenting line below will save with the expected upper case as in the $xml variable 
#[System.IO.File]::WriteAllLines('c:\temp\lower.xml',$xml.OuterXml,$utf8WithoutBom)

 I was hoping if there was a better answer to why and if there is a setting I could set so wouldn't need to use WriteAllLines.
 

Thanks in advance.


Joe--

Make non-editable ComboBox in Powershell

$
0
0

So I'm writing a GUI that will interface with 3D printers.  I'm still fairly new to Powershell in general.

Here is what I have in my code right now:

  # == Baudrate Combo Box == #
  $comboBox1 = New-Object System.Windows.Forms.ComboBox
  $comboBox1.Location = New-Object System.Drawing.Point(80, 55)
  $comboBox1.Size = New-Object System.Drawing.Size(98, 10)
  $comboBox1.Items.add("250000")
  $comboBox1.Items.add("115200")

So the list is generated just fine, and my options appear and can be selected as they should be.  The only thing that doesn't work right, is that the ComboBox text area is editable.  The edited text never passes, which is good, but I want that box to be purely read/select only.

I've seen some very generic statements all over the place, but none of them work, or are based in a different programming language like C#.

I've tried adding the following, with no luck:

  $comboBox1.DropDownStyle = ComboBoxStyle.DropDownList

Running with this line inserted gives me this:

ComboBoxStyle.DropDownList : The term 'ComboBoxStyle.DropDownList' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\chevy\Desktop\GUI PROGRAM\TESTING.ps1:216 char:30+   $comboBox1.DropDownStyle = ComboBoxStyle.DropDownList+                              ~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : ObjectNotFound: (ComboBoxStyle.DropDownList:String) [], CommandNotFoundException+ FullyQualifiedErrorId : CommandNotFoundException
I've been at this for a couple days now, and I have yet to find a way to make the combo box read only.

Issue to log powershell with invoke-command

$
0
0

Hello,

I'm currently trying to improve my own powershell script to audit Active Directory and I don't know how to do to log with Invoke-command.

Sample here :

function Get-TimeSource {
    Write-EZLog -Category INF -Message "### Start Get-TimeSource ###"
    Invoke-Command -ComputerName $alldcs.name -ScriptBlock {
        [PSCustomObject]@{
             Server = $env:COMPUTERNAME
             TimeSource = w32tm /query /source  
        } 
    } | Select-Object Server,TimeSource | Sort-Object server
    Write-EZLog -Category INF -Message "### End Get-TimeSource ###"

 }

I would like to log

Processing computer "current Computer"

But I don't know where I can put it because scriptblock is executer on remote computer...


Merci de marquer comme reponses les interventions qui vous ont ete utile.


Get-NetConnectionProfile piped to show results based on 2 of the values?

$
0
0

Hi all

Get-NetConnectionProfile

This lists multiple connections.

What command can I use to give me the results for just the below connection ie 

if the InterfaceAlias is "Tunnel" and the Name is "mydomain.uk"   ?

Name : mydomain.uk
InterfaceAlias : Tunnel
InterfaceIndex : 87
NetworkCategory : DomainAuthenticated
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic

I've tried a piped where -match - like -eq, I'm getting the syntax wrong somewhere.

Thanks for any info.

Bad PS Command Causes Critial Stop - Hyper-V 2016

$
0
0

Hi,

I just installed Hyper-V 2016 and applied the latest Updates.

I started PowerShell and entered an incorrect command in PowerShell - I was trying to get a list of the services status and should have entered "get-service". I made a mistake and entered "services" instead. That is obviously a mistake, but should it have had critical consequences for the server?

When I entered the command, I got a Critical Stop ("Your PC ran into a problem and needs to restart . . . . " The Stop Code was CRITICAL PROCESS DIED.

(This is repeatable)

Is this expected behaviour when entering a bad command in PowerShell (I hope not!). I am reluctant to go ahead and complete configuration of the server now, including installing the VMs. Do I have a critical problem with the server, or is it all down to"pilot error"? 

Does the (bad) "services" command have any special meaning, or is PowerShell prone to being able to kill a server like this?

regards


Dave



add email for alerting

$
0
0

  

 How could I add multiple servers to status of SSAS, and if state<> Processed send an email alert?

 Currently just one server lookup with file capture.

 Thanks.

[CmdletBinding()]

$ssasInstance = 'xxxxxx'
 
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices")
$server = New-Object Microsoft.AnalysisServices.Server
$server.connect($ssasInstance)
$database=$server.databases
foreach ($db in $server.databases)
{
$dbwriteout = $db|select name,state
$dbwriteout | Sort name | Export-Csv 'C:\cube_status.csv' -Append -NoTypeInformation
$Cubes=New-object Microsoft.AnalysisServices.Cube
$Cubes=$db.cubes
}

$port.Open() always returns null-value

$
0
0

This seems to work about 10% of the time, and I'm having trouble figuring out why.

This is the code section in question:

  $Connect_OnClick={
     $baudrate = $comboBox1.SelectedItem.ToString()
     $port = New-Object System.IO.Ports.SerialPort COM6,$baudrate,None,8,one
     $port.Open()
     $port.WriteLine("G28 X")
  }

That works all well and good.  But if I try another button like this:

  $HomeX_OnClick={
     Write-Host "Homing X"
     $port.WriteLine("G28 X")
  }

Then it throws the following error:

You cannot call a method on a null-valued expression.
At C:\Users\chevy\Desktop\GUI PROGRAM\TESTING.ps1:51 char:6
+      $port.WriteLine("G28 X")
+      ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Fully save Pipeline output

$
0
0

Hi,
to speed up the execution of some scripts I need to permanently save the result of a pipeline (or a variable).

I tried to save yes .csv and on .xml but I realized that some "MemberType" (in particular the "Method") are not then reloaded on the next import.

Is there a way to fully export and import all "MemberType" to a file ??


many thanks in advance.

PS C:\tmp> $myva1 = Get-Process

PS C:\tmp> $myva1 | Export-Clixml testfileexport.xml

PS C:\tmp> $myva2 = Import-Clixml .\testfileexport.xml

PS C:\tmp> $myva1 | Get-Member -Force


   TypeName: System.Diagnostics.Process

Name                           MemberType     Definition                                                                                                               
----                           ----------     ----------                                                                                                               
Handles                        AliasProperty  Handles = Handlecount                                                                                                    
Name                           AliasProperty  Name = ProcessName                                                                                                       
NPM                            AliasProperty  NPM = NonpagedSystemMemorySize64                                                                                         
PM                             AliasProperty  PM = PagedMemorySize64                                                                                                   
SI                             AliasProperty  SI = SessionId                                                                                                           
VM                             AliasProperty  VM = VirtualMemorySize64                                                                                                 
WS                             AliasProperty  WS = WorkingSet64                                                                                                        
pstypenames                    CodeProperty   System.Collections.ObjectModel.Collection`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken...
Disposed                       Event          System.EventHandler Disposed(System.Object, System.EventArgs)                                                            
ErrorDataReceived              Event          System.Diagnostics.DataReceivedEventHandler ErrorDataReceived(System.Object, System.Diagnostics.DataReceivedEventArgs)   
Exited                         Event          System.EventHandler Exited(System.Object, System.EventArgs)                                                              
OutputDataReceived             Event          System.Diagnostics.DataReceivedEventHandler OutputDataReceived(System.Object, System.Diagnostics.DataReceivedEventArgs)  
psadapted                      MemberSet      psadapted {BasePriority, ExitCode, HasExited, ExitTime, Handle, SafeHandle, HandleCount, Id, MachineName, MainWindowHa...
psbase                         MemberSet      psbase {BasePriority, ExitCode, HasExited, ExitTime, Handle, SafeHandle, HandleCount, Id, MachineName, MainWindowHandl...
psextended                     MemberSet      psextended {PSConfiguration, PSResources, Name, SI, Handles, VM, WS, PM, NPM, Path, Company, CPU, FileVersion, Product...
psobject                       MemberSet      psobject {BaseObject, Members, Properties, Methods, ImmediateBaseObject, TypeNames, get_BaseObject, get_Members, get_P...
PSStandardMembers              MemberSet      PSStandardMembers {DefaultDisplayPropertySet}                                                                            
add_Disposed                   Method         void add_Disposed(System.EventHandler value), void IComponent.add_Disposed(System.EventHandler value)                    
add_ErrorDataReceived          Method         void add_ErrorDataReceived(System.Diagnostics.DataReceivedEventHandler value)                                            
add_Exited                     Method         void add_Exited(System.EventHandler value)                                                                               
add_OutputDataReceived         Method         void add_OutputDataReceived(System.Diagnostics.DataReceivedEventHandler value)                                           
BeginErrorReadLine             Method         void BeginErrorReadLine()                                                                                                
BeginOutputReadLine            Method         void BeginOutputReadLine()                                                                                               
CancelErrorRead                Method         void CancelErrorRead()                                                                                                   
CancelOutputRead               Method         void CancelOutputRead()                                                                                                  
Close                          Method         void Close()                                                                                                             
CloseMainWindow                Method         bool CloseMainWindow()                                                                                                   
CreateObjRef                   Method         System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)                                                          
Dispose                        Method         void Dispose(), void IDisposable.Dispose()                                                                               
Equals                         Method         bool Equals(System.Object obj)                                                                                           
GetHashCode                    Method         int GetHashCode()                                                                                                        
GetLifetimeService             Method         System.Object GetLifetimeService()                                                                                       
GetType                        Method         type GetType()                                                                                                           
get_BasePriority               Method         int get_BasePriority()                                                                                                   
get_Container                  Method         System.ComponentModel.IContainer get_Container()                                                                         
get_EnableRaisingEvents        Method         bool get_EnableRaisingEvents()                                                                                           
get_ExitCode                   Method         int get_ExitCode()                                                                                                       
get_ExitTime                   Method         datetime get_ExitTime()                                                                                                  
get_Handle                     Method         System.IntPtr get_Handle()                                                                                               
get_HandleCount                Method         int get_HandleCount()                                                                                                    
get_HasExited                  Method         bool get_HasExited()                                                                                                     
get_Id                         Method         int get_Id()                                                                                                             
get_MachineName                Method         string get_MachineName()                                                                                                 
get_MainModule                 Method         System.Diagnostics.ProcessModule get_MainModule()                                                                        
get_MainWindowHandle           Method         System.IntPtr get_MainWindowHandle()                                                                                     
get_MainWindowTitle            Method         string get_MainWindowTitle()                                                                                             
get_MaxWorkingSet              Method         System.IntPtr get_MaxWorkingSet()                                                                                        
get_MinWorkingSet              Method         System.IntPtr get_MinWorkingSet()                                                                                        
get_Modules                    Method         System.Diagnostics.ProcessModuleCollection get_Modules()                                                                 
get_NonpagedSystemMemorySize   Method         int get_NonpagedSystemMemorySize()                                                                                       
get_NonpagedSystemMemorySize64 Method         long get_NonpagedSystemMemorySize64()                                                                                    
get_PagedMemorySize            Method         int get_PagedMemorySize()                                                                                                
get_PagedMemorySize64          Method         long get_PagedMemorySize64()                                                                                             
get_PagedSystemMemorySize      Method         int get_PagedSystemMemorySize()                                                                                          
get_PagedSystemMemorySize64    Method         long get_PagedSystemMemorySize64()                                                                                       
get_PeakPagedMemorySize        Method         int get_PeakPagedMemorySize()                                                                                            
get_PeakPagedMemorySize64      Method         long get_PeakPagedMemorySize64()                                                                                         
get_PeakVirtualMemorySize      Method         int get_PeakVirtualMemorySize()                                                                                          
get_PeakVirtualMemorySize64    Method         long get_PeakVirtualMemorySize64()                                                                                       
get_PeakWorkingSet             Method         int get_PeakWorkingSet()                                                                                                 
get_PeakWorkingSet64           Method         long get_PeakWorkingSet64()                                                                                              
get_PriorityBoostEnabled       Method         bool get_PriorityBoostEnabled()                                                                                          
get_PriorityClass              Method         System.Diagnostics.ProcessPriorityClass get_PriorityClass()                                                              
get_PrivateMemorySize          Method         int get_PrivateMemorySize()                                                                                              
get_PrivateMemorySize64        Method         long get_PrivateMemorySize64()                                                                                           
get_PrivilegedProcessorTime    Method         timespan get_PrivilegedProcessorTime()                                                                                   
get_ProcessName                Method         string get_ProcessName()                                                                                                 
get_ProcessorAffinity          Method         System.IntPtr get_ProcessorAffinity()                                                                                    
get_Responding                 Method         bool get_Responding()                                                                                                    
get_SafeHandle                 Method         Microsoft.Win32.SafeHandles.SafeProcessHandle get_SafeHandle()                                                           
get_SessionId                  Method         int get_SessionId()                                                                                                      
get_Site                       Method         System.ComponentModel.ISite get_Site(), System.ComponentModel.ISite IComponent.get_Site()                                
get_StandardError              Method         System.IO.StreamReader get_StandardError()                                                                               
get_StandardInput              Method         System.IO.StreamWriter get_StandardInput()                                                                               
get_StandardOutput             Method         System.IO.StreamReader get_StandardOutput()                                                                              
get_StartInfo                  Method         System.Diagnostics.ProcessStartInfo get_StartInfo()                                                                      
get_StartTime                  Method         datetime get_StartTime()                                                                                                 
get_SynchronizingObject        Method         System.ComponentModel.ISynchronizeInvoke get_SynchronizingObject()                                                       
get_Threads                    Method         System.Diagnostics.ProcessThreadCollection get_Threads()                                                                 
get_TotalProcessorTime         Method         timespan get_TotalProcessorTime()                                                                                        
get_UserProcessorTime          Method         timespan get_UserProcessorTime()                                                                                         
get_VirtualMemorySize          Method         int get_VirtualMemorySize()                                                                                              
get_VirtualMemorySize64        Method         long get_VirtualMemorySize64()                                                                                           
get_WorkingSet                 Method         int get_WorkingSet()                                                                                                     
get_WorkingSet64               Method         long get_WorkingSet64()                                                                                                  
InitializeLifetimeService      Method         System.Object InitializeLifetimeService()                                                                                
Kill                           Method         void Kill()                                                                                                              
Refresh                        Method         void Refresh()                                                                                                           
remove_Disposed                Method         void remove_Disposed(System.EventHandler value), void IComponent.remove_Disposed(System.EventHandler value)              
remove_ErrorDataReceived       Method         void remove_ErrorDataReceived(System.Diagnostics.DataReceivedEventHandler value)                                         
remove_Exited                  Method         void remove_Exited(System.EventHandler value)                                                                            
remove_OutputDataReceived      Method         void remove_OutputDataReceived(System.Diagnostics.DataReceivedEventHandler value)                                        
set_EnableRaisingEvents        Method         void set_EnableRaisingEvents(bool value)                                                                                 
set_MaxWorkingSet              Method         void set_MaxWorkingSet(System.IntPtr value)                                                                              
set_MinWorkingSet              Method         void set_MinWorkingSet(System.IntPtr value)                                                                              
set_PriorityBoostEnabled       Method         void set_PriorityBoostEnabled(bool value)                                                                                
set_PriorityClass              Method         void set_PriorityClass(System.Diagnostics.ProcessPriorityClass value)                                                    
set_ProcessorAffinity          Method         void set_ProcessorAffinity(System.IntPtr value)                                                                          
set_Site                       Method         void set_Site(System.ComponentModel.ISite value), void IComponent.set_Site(System.ComponentModel.ISite value)            
set_StartInfo                  Method         void set_StartInfo(System.Diagnostics.ProcessStartInfo value)                                                            
set_SynchronizingObject        Method         void set_SynchronizingObject(System.ComponentModel.ISynchronizeInvoke value)                                             
Start                          Method         bool Start()                                                                                                             
ToString                       Method         string ToString()                                                                                                        
WaitForExit                    Method         bool WaitForExit(int milliseconds), void WaitForExit()                                                                   
WaitForInputIdle               Method         bool WaitForInputIdle(int milliseconds), bool WaitForInputIdle()                                                         
__NounName                     NoteProperty   string __NounName=Process                                                                                                
BasePriority                   Property       int BasePriority {get;}                                                                                                  
Container                      Property       System.ComponentModel.IContainer Container {get;}                                                                        
EnableRaisingEvents            Property       bool EnableRaisingEvents {get;set;}                                                                                      
ExitCode                       Property       int ExitCode {get;}                                                                                                      
ExitTime                       Property       datetime ExitTime {get;}                                                                                                 
Handle                         Property       System.IntPtr Handle {get;}                                                                                              
HandleCount                    Property       int HandleCount {get;}                                                                                                   
HasExited                      Property       bool HasExited {get;}                                                                                                    
Id                             Property       int Id {get;}                                                                                                            
MachineName                    Property       string MachineName {get;}                                                                                                
MainModule                     Property       System.Diagnostics.ProcessModule MainModule {get;}                                                                       
MainWindowHandle               Property       System.IntPtr MainWindowHandle {get;}                                                                                    
MainWindowTitle                Property       string MainWindowTitle {get;}                                                                                            
MaxWorkingSet                  Property       System.IntPtr MaxWorkingSet {get;set;}                                                                                   
MinWorkingSet                  Property       System.IntPtr MinWorkingSet {get;set;}                                                                                   
Modules                        Property       System.Diagnostics.ProcessModuleCollection Modules {get;}                                                                
NonpagedSystemMemorySize       Property       int NonpagedSystemMemorySize {get;}                                                                                      
NonpagedSystemMemorySize64     Property       long NonpagedSystemMemorySize64 {get;}                                                                                   
PagedMemorySize                Property       int PagedMemorySize {get;}                                                                                               
PagedMemorySize64              Property       long PagedMemorySize64 {get;}                                                                                            
PagedSystemMemorySize          Property       int PagedSystemMemorySize {get;}                                                                                         
PagedSystemMemorySize64        Property       long PagedSystemMemorySize64 {get;}                                                                                      
PeakPagedMemorySize            Property       int PeakPagedMemorySize {get;}                                                                                           
PeakPagedMemorySize64          Property       long PeakPagedMemorySize64 {get;}                                                                                        
PeakVirtualMemorySize          Property       int PeakVirtualMemorySize {get;}                                                                                         
PeakVirtualMemorySize64        Property       long PeakVirtualMemorySize64 {get;}                                                                                      
PeakWorkingSet                 Property       int PeakWorkingSet {get;}                                                                                                
PeakWorkingSet64               Property       long PeakWorkingSet64 {get;}                                                                                             
PriorityBoostEnabled           Property       bool PriorityBoostEnabled {get;set;}                                                                                     
PriorityClass                  Property       System.Diagnostics.ProcessPriorityClass PriorityClass {get;set;}                                                         
PrivateMemorySize              Property       int PrivateMemorySize {get;}                                                                                             
PrivateMemorySize64            Property       long PrivateMemorySize64 {get;}                                                                                          
PrivilegedProcessorTime        Property       timespan PrivilegedProcessorTime {get;}                                                                                  
ProcessName                    Property       string ProcessName {get;}                                                                                                
ProcessorAffinity              Property       System.IntPtr ProcessorAffinity {get;set;}                                                                               
Responding                     Property       bool Responding {get;}                                                                                                   
SafeHandle                     Property       Microsoft.Win32.SafeHandles.SafeProcessHandle SafeHandle {get;}                                                          
SessionId                      Property       int SessionId {get;}                                                                                                     
Site                           Property       System.ComponentModel.ISite Site {get;set;}                                                                              
StandardError                  Property       System.IO.StreamReader StandardError {get;}                                                                              
StandardInput                  Property       System.IO.StreamWriter StandardInput {get;}                                                                              
StandardOutput                 Property       System.IO.StreamReader StandardOutput {get;}                                                                             
StartInfo                      Property       System.Diagnostics.ProcessStartInfo StartInfo {get;set;}                                                                 
StartTime                      Property       datetime StartTime {get;}                                                                                                
SynchronizingObject            Property       System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get;set;}                                                  
Threads                        Property       System.Diagnostics.ProcessThreadCollection Threads {get;}                                                                
TotalProcessorTime             Property       timespan TotalProcessorTime {get;}                                                                                       
UserProcessorTime              Property       timespan UserProcessorTime {get;}                                                                                        
VirtualMemorySize              Property       int VirtualMemorySize {get;}                                                                                             
VirtualMemorySize64            Property       long VirtualMemorySize64 {get;}                                                                                          
WorkingSet                     Property       int WorkingSet {get;}                                                                                                    
WorkingSet64                   Property       long WorkingSet64 {get;}                                                                                                 
PSConfiguration                PropertySet    PSConfiguration {Name, Id, PriorityClass, FileVersion}                                                                   
PSResources                    PropertySet    PSResources {Name, Id, Handlecount, WorkingSet, NonPagedMemorySize, PagedMemorySize, PrivateMemorySize, VirtualMemoryS...
Company                        ScriptProperty System.Object Company {get=$this.Mainmodule.FileVersionInfo.CompanyName;}                                                
CPU                            ScriptProperty System.Object CPU {get=$this.TotalProcessorTime.TotalSeconds;}                                                           
Description                    ScriptProperty System.Object Description {get=$this.Mainmodule.FileVersionInfo.FileDescription;}                                        
FileVersion                    ScriptProperty System.Object FileVersion {get=$this.Mainmodule.FileVersionInfo.FileVersion;}                                            
Path                           ScriptProperty System.Object Path {get=$this.Mainmodule.FileName;}                                                                      
Product                        ScriptProperty System.Object Product {get=$this.Mainmodule.FileVersionInfo.ProductName;}                                                
ProductVersion                 ScriptProperty System.Object ProductVersion {get=$this.Mainmodule.FileVersionInfo.ProductVersion;}                                      



PS C:\tmp> $myva2 | Get-Member -Force


   TypeName: Deserialized.System.Diagnostics.Process

Name                       MemberType   Definition                                                                                                                     
----                       ----------   ----------                                                                                                                     
pstypenames                CodeProperty System.Collections.ObjectModel.Collection`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5...
psadapted                  MemberSet    psadapted {BasePriority, HandleCount, Id, MachineName, MainWindowHandle, MainWindowTitle, NonpagedSystemMemorySize, Nonpaged...
psbase                     MemberSet    psbase {}                                                                                                                      
psextended                 MemberSet    psextended {ToString, GetType, Name, SI, Handles, VM, WS, PM, NPM, Path, Company, CPU, FileVersion, ProductVersion, Descript...
psobject                   MemberSet    psobject {BaseObject, Members, Properties, Methods, ImmediateBaseObject, TypeNames, get_BaseObject, get_Members, get_Propert...
PSStandardMembers          MemberSet    PSStandardMembers {DefaultDisplayPropertySet}                                                                                  
GetType                    Method       type GetType()                                                                                                                 
ToString                   Method       string ToString(), string ToString(string format, System.IFormatProvider formatProvider), string IFormattable.ToString(strin...
Company                    NoteProperty object Company=null                                                                                                            
CPU                        NoteProperty object CPU=null                                                                                                                
Description                NoteProperty object Description=null                                                                                                        
FileVersion                NoteProperty object FileVersion=null                                                                                                        
Handles                    NoteProperty int Handles=3074                                                                                                               
Name                       NoteProperty string Name=aeagent                                                                                                            
NPM                        NoteProperty long NPM=19232                                                                                                                 
Path                       NoteProperty object Path=null                                                                                                               
PM                         NoteProperty long PM=6561792                                                                                                                
Product                    NoteProperty object Product=null                                                                                                            
ProductVersion             NoteProperty object ProductVersion=null                                                                                                     
SI                         NoteProperty int SI=0                                                                                                                       
VM                         NoteProperty long VM=70529024                                                                                                               
WS                         NoteProperty long WS=8605696                                                                                                                
__NounName                 NoteProperty string __NounName=Process                                                                                                      
BasePriority               Property     System.Int32 {get;set;}                                                                                                        
Container                  Property      {get;set;}                                                                                                                    
EnableRaisingEvents        Property     System.Boolean {get;set;}                                                                                                      
HandleCount                Property     System.Int32 {get;set;}                                                                                                        
Id                         Property     System.Int32 {get;set;}                                                                                                        
MachineName                Property     System.String {get;set;}                                                                                                       
MainWindowHandle           Property     Deserialized.System.IntPtr {get;set;}                                                                                          
MainWindowTitle            Property     System.String {get;set;}                                                                                                       
NonpagedSystemMemorySize   Property     System.Int32 {get;set;}                                                                                                        
NonpagedSystemMemorySize64 Property     System.Int64 {get;set;}                                                                                                        
PagedMemorySize            Property     System.Int32 {get;set;}                                                                                                        
PagedMemorySize64          Property     System.Int64 {get;set;}                                                                                                        
PagedSystemMemorySize      Property     System.Int32 {get;set;}                                                                                                        
PagedSystemMemorySize64    Property     System.Int64 {get;set;}                                                                                                        
PeakPagedMemorySize        Property     System.Int32 {get;set;}                                                                                                        
PeakPagedMemorySize64      Property     System.Int64 {get;set;}                                                                                                        
PeakVirtualMemorySize      Property     System.Int32 {get;set;}                                                                                                        
PeakVirtualMemorySize64    Property     System.Int64 {get;set;}                                                                                                        
PeakWorkingSet             Property     System.Int32 {get;set;}                                                                                                        
PeakWorkingSet64           Property     System.Int64 {get;set;}                                                                                                        
PrivateMemorySize          Property     System.Int32 {get;set;}                                                                                                        
PrivateMemorySize64        Property     System.Int64 {get;set;}                                                                                                        
ProcessName                Property     System.String {get;set;}                                                                                                       
Responding                 Property     System.Boolean {get;set;}                                                                                                      
SessionId                  Property     System.Int32 {get;set;}                                                                                                        
Site                       Property      {get;set;}                                                                                                                    
StartInfo                  Property     Deserialized.System.Diagnostics.ProcessStartInfo {get;set;}                                                                    
SynchronizingObject        Property      {get;set;}                                                                                                                    
Threads                    Property     Deserialized.System.Diagnostics.ProcessThreadCollection {get;set;}                                                             
VirtualMemorySize          Property     System.Int32 {get;set;}                                                                                                        
VirtualMemorySize64        Property     System.Int64 {get;set;}                                                                                                        
WorkingSet                 Property     System.Int32 {get;set;}                                                                                                        
WorkingSet64               Property     System.Int64 {get;set;}                                                                                                        
PSConfiguration            PropertySet  PSConfiguration {Name, Id, PriorityClass, FileVersion}                                                                         
PSResources                PropertySet  PSResources {Name, Id, Handlecount, WorkingSet, NonPagedMemorySize, PagedMemorySize, PrivateMemorySize, VirtualMemorySize, T...



PS C:\tmp> 

Viewing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>