# PowerShell Pipe Options and Functions List

Here is a list of the commands we will cover.

Each command has a link to the Microsoft Reference Page with full Description, Syntax and Examples, but a short description and some examples are supplied here.

You can get this same list by running the following command.
Get-Command | where {$_.Source -eq "Microsoft.PowerShell.Management" } | Sort-Object Name WE WILL BE COVERING THE FOLLOWING COMMANDS SCROLL DOWN FOR ALL THE DETAILS OF EACH COMMAND Commands ConvertFrom-SddlString Format-Hex Get-FileHash Import-PowerShellDataFile New-Guid New-TemporaryFile Add-Member Add-Type Clear-Variable Compare-Object ConvertFrom-Csv ConvertFrom-Json ConvertFrom-String ConvertFrom-StringData Convert-String ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-Xml Debug-Runspace Disable-PSBreakpoint Disable-RunspaceDebug Enable-PSBreakpoint Enable-RunspaceDebug Export-Alias Export-Clixml Export-Csv Export-FormatData Export-PSSession Format-Custom Format-List Format-Table Format-Wide Get-Alias Get-Culture Get-Date Get-Event Get-EventSubscriber Get-FormatData Get-Host Get-Member Get-PSBreakpoint Get-PSCallStack Get-Random Get-Runspace Get-RunspaceDebug Get-TraceSource Get-TypeData Get-UICulture Get-Unique Get-Variable Group-Object Import-Alias Import-Clixml Import-Csv Import-LocalizedData Import-PSSession Invoke-Expression Invoke-RestMethod Invoke-WebRequest Measure-Command Measure-Object New-Alias New-Event New-Object New-TimeSpan New-Variable Out-File Out-GridView Out-Printer Out-String Read-Host Register-EngineEvent Register-ObjectEvent Remove-Event Remove-PSBreakpoint Remove-TypeData Remove-Variable Select-Object Select-String Select-Xml Send-MailMessage Set-Alias Set-Date Set-PSBreakpoint Set-TraceSource Set-Variable Show-Command Sort-Object Start-Sleep Tee-Object Trace-Command Unblock-File Unregister-Event Update-FormatData Update-List Update-TypeData Wait-Debugger Wait-Event Write-Debug Write-Error Write-Host Write-Information Write-Output Write-Progress Write-Verbose Write-Warning BE SURE TO CHECK OUT OUR AWESOME FREE AND PREMIUM TOOLS AFTER YOU CHECK OUT THIS LIST ## Add-Member DESCRIPTION The Add-Member cmdlet lets you add members (properties and methods) to an instance of a PowerShell object. For instance, you can add a NoteProperty member that contains a description of the object or a ScriptMethod member that runs a script to change the object. EXAMPLE$A = Get-ChildItem c:\ps-test\test.txt
$A | Add-Member -NotePropertyName Status -NotePropertyValue Done OUTPUT$A.Status
Done

DESCRIPTION

The Add-Type cmdlet lets you define a Microsoft .NET Core class in your PowerShell session. You can then instantiate objects, by using the New-Object cmdlet, and use the objects just as you would use any .NET Core object. If you add an Add-Type command to your PowerShell profile, the class is available in all PowerShell sessions.

EXAMPLE

$Source = @" public class BasicTest { public static int Add(int a, int b) { return (a + b); } public int Multiply(int a, int b) { return (a * b); } } "@ Add-Type -TypeDefinition$Source
$BasicTestObject = New-Object BasicTest$BasicTestObject.Multiply(5, 2)

## Clear-Variable

DESCRIPTION

The Clear-Variable cmdlet deletes the data stored in a variable, but it does not delete the variable. As a result, the value of the variable is NULL (empty). If the variable has a specified data or object type, this cmdlet preserves the type of the object stored in the variable.

EXAMPLE

Clear-Variable my* -Scope Global

## Compare-Object

DESCRIPTION

The Compare-Object cmdlet compares two sets of objects. One set of objects is the reference, and the other set of objects is the difference.

EXAMPLE

Compare-Object -ReferenceObject (Get-Content -Path C:\Test\Testfile1.txt) -DifferenceObject (Get-Content -Path C:\Test\Testfile2.txt)

OUTPUT

InputObject SideIndicator
----------- -------------
cat =>
racoon =>
dog <=
squirrel <=

## ConvertFrom-Csv

DESCRIPTION

The ConvertFrom-Csv cmdlet creates objects from CSV variable-length strings that are generated by the ConvertTo-Csv cmdlet.

EXAMPLE

$P = Get-Process | ConvertTo-Csv$P | ConvertFrom-Csv

## ConvertFrom-Json

DESCRIPTION

The ConvertFrom-Json cmdlet converts a JavaScript Object Notation (JSON) formatted string to a custom PSCustomObject object that has a property for each field in the JSON string. JSON is commonly used by web sites to provide a textual representation of objects. The JSON standard does not prohibit usage that is prohibited with a PSCustomObject. For example, if the JSON string contains duplicate keys, only the last key is used by this cmdlet. See other examples below.

EXAMPLE

Get-Date | Select-Object -Property * | ConvertTo-Json | ConvertFrom-Json

## ConvertFrom-SddlString

DESCRIPTION

The ConvertFrom-SddlString cmdlet converts a Security Descriptor Definition Language string to a custom PSCustomObject object with the following properties: Owner, Group, DiscretionaryAcl, SystemAcl and RawDescriptor.

EXAMPLE

$acl = Get-Acl -Path C:\Windows ConvertFrom-SddlString -Sddl$acl.Sddl

## ConvertFrom-String

DESCRIPTION

The ConvertFrom-String cmdlet extracts and parses structured properties from string content. This cmdlet generates an object by parsing text from a traditional text stream. For each string in the pipeline, the cmdlet splits the input by either a delimiter or a parse expression, and then assigns property names to each of the resulting split elements. You can provide these property names; if you do not, they are automatically generated for you.

EXAMPLE

"Hello World" | ConvertFrom-String

## ConvertFrom-StringData

DESCRIPTION

The ConvertFrom-StringData cmdlet converts a string that contains one or more key and value pairs into a hash table. Because each key-value pair must be on a separate line, here-strings are often used as the input format. By default, the key must be separated from the value by an equals sign (=) character.

EXAMPLE

$Here = @' Msg1 = The string parameter is required. Msg2 = Credentials are required for this command. Msg3 = The specified variable does not exist. '@ ConvertFrom-StringData -StringData$Here

OUTPUT

Name Value
---- -----
Msg3 The specified variable does not exist.
Msg2 Credentials are required for this command.
Msg1 The string parameter is required.

## Convert-String

DESCRIPTION

The cmdlet formats a string to match the format of examples.

EXAMPLE

"Mu Han", "Jim Hance", "David Ahs", "Kim Akers" | Convert-String -Example "Ed Wilson=Wilson, E."

OUTPUT

Han, M.
Hance, J.
Ahs, D.
Akers, K.

## ConvertTo-Csv

DESCRIPTION

The ConvertTo-CSV cmdlet returns a series of comma-separated value (CSV) strings that represent the objects that you submit. You can then use the ConvertFrom-Csv cmdlet to recreate objects from the CSV strings. The objects converted from CSV are string values of the original objects that contain property values and no methods.

EXAMPLE

Get-Process -Name pwsh | ConvertTo-Csv -NoTypeInformation -Delimiter ","

OUTPUT

"Name","SI","Handles","VM","WS","PM","NPM","Path","Parent","Company","CPU","FileVersion", ...
"pwsh","8","950","2204001161216","100925440","59686912","67104", ...

## ConvertTo-Html

DESCRIPTION

The ConvertTo-Html cmdlet converts .NET objects into HTML that can be displayed in a Web browser. You can use this cmdlet to display the output of a command in a Web page.

EXAMPLE

Get-Alias | ConvertTo-Html | Out-File aliases.htm
Invoke-Item aliases.htm

## ConvertTo-Json

DESCRIPTION

The ConvertTo-Json cmdlet converts any .NET object to a string in JavaScript Object Notation (JSON) format. The properties are converted to field names, the field values are converted to property values, and the methods are removed.

EXAMPLE

(Get-UICulture).Calendar | ConvertTo-Json

OUTPUT

{
"MinSupportedDateTime": "0001-01-01T00:00:00",
"MaxSupportedDateTime": "9999-12-31T23:59:59.9999999",
"AlgorithmType": 1,
"CalendarType": 1,
"Eras": [
1
],
"TwoDigitYearMax": 2029,
}

## ConvertTo-Xml

DESCRIPTION

The ConvertTo-Xml cmdlet creates an XML-based representation of one or more .NET objects. To use this cmdlet, pipe one or more objects to the cmdlet, or use the InputObject parameter to specify the object.

EXAMPLE

Get-Date | ConvertTo-Xml

## Debug-Runspace

DESCRIPTION

The Debug-Runspace cmdlet starts an interactive debugging session with a local or remote active runspace. You can find a runspace that you want to debug by first running Get-Process to find processes associated with PowerShell, then Enter-PSHostProcess with the process ID specified in the Id parameter to attach to the process, and then Get-Runspace to list runspaces within the PowerShell host process.

EXAMPLE

Get-Process -ComputerName "WS10TestServer" -Name "*powershell*"

Handles WS(K) VM(M) CPU(s) Id ProcessName
------- ----- ----- ------ -- -----------
377 69912 63 2.09 2420 powershell
399 123396 829 4.48 1152 powershell_ise

Enter-PSSession -ComputerName "WS10TestServer"
[WS10TestServer]:Enter-PSHostProcess -Id 1152
[WS10TestServer:][Process:1152]: Get-Runspace

Id Name ComputerName Type State Availability
-- ---- ------------ ---- ----- ------------
1 Runspace1 WS10TestServer Remote Opened Available
2 RemoteHost WS10TestServer Remote Opened Busy

[WS10TestServer][Process:1152]: > Debug-Runspace -Id 2

Hit Line breakpoint on 'C:\TestWFVar1.ps1:83'
At C:\TestWFVar1.ps1:83 char:1
Export-PSSession -Session $S -OutputModule Server01 ## Format-Custom DESCRIPTION The Format-Custom cmdlet formats the output of a command as defined in an alternate view. Format-Custom is designed to display views that are not just tables or just lists. You can use the views defined in PowerShell, or you can create your own views in a new format.ps1xml file and use the Update-FormatData cmdlet to add them to PowerShell. EXAMPLE Get-Command Start-Transcript | Format-Custom -View MyView ## Format-Hex DESCRIPTION The Format-Hex cmdlet displays a file or other input as hexadecimal values. To determine the offset of a character from the output, add the number at the leftmost of the row to the number at the top of the column for that character. EXAMPLE 'Hello World' | Format-Hex Label: String (System.String) <2944BEC3> Offset Bytes Ascii 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ------ ----------------------------------------------- ----- 0000000000000000 48 65 6C 6C 6F 20 57 6F 72 6C 64 Hello World ## Format-List DESCRIPTION The Format-List cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use Format-List to format and display all or selected properties of an object as a list (format-list *) EXAMPLE Get-Service | Format-List ## Format-Table DESCRIPTION The Format-Table cmdlet formats the output of a command as a table with the selected properties of the object in each column. The object type determines the default layout and properties that are displayed in each column. You can use the Property parameter to select the properties that you want to display. EXAMPLE Get-Host | Format-Table -AutoSize ## Format-Wide DESCRIPTION The Format-Wide cmdlet formats objects as a wide table that displays only one property of each object. You can use the Property parameter to determine which property is displayed. EXAMPLE Get-ChildItem | Format-Wide -Column 3 ## Get-Alias DESCRIPTION The Get-Alias cmdlet gets the aliases in the current session. This includes built-in aliases, aliases that you have set or imported, and aliases that you have added to your PowerShell profile. EXAMPLE Get-Alias CommandType Name ----------- ---- Alias % -> ForEach-Object Alias ? -> Where-Object Alias ac -> Add-Content Alias asnp -> Add-PSSnapin Alias cat -> Get-Content Alias cd -> Set-Location Alias chdir -> Set-Location Alias clc -> Clear-Content Alias clear -> Clear-Host Alias clhy -> Clear-History ## Get-Culture DESCRIPTION The Get-Culture cmdlet gets information about the current culture settings. This includes information about the current language settings on the system, such as the keyboard layout, and the display format of items such as numbers, currency, and dates. EXAMPLE Get-Culture LCID Name DisplayName ---- ---- ----------- 1033 en-US English (United States) ## Get-Date DESCRIPTION The Get-Date cmdlet gets a DateTime object that represents the current date or a date that you specify. Get-Date can format the date and time in several .NET and UNIX formats. You can use Get-Date to generate a date or time character string, and then send the string to other cmdlets or programs. EXAMPLE Get-Date Get-Date.AddDays(-1) OUTPUT Tuesday, June 25, 2019 14:53:32 Tuesday, June 24, 2019 14:53:32 ## Get-Event DESCRIPTION The Get-EventLog cmdlet gets events and event logs from local and remote computers. By default, Get-EventLog gets logs from the local computer. To get logs from remote computers, use the ComputerName parameter. EXAMPLE Get-EventLog -List OUTPUT Max(K) Retain OverflowAction Entries Log ------ ------ -------------- ------- --- 15,168 0 OverwriteAsNeeded 20,792 Application 15,168 0 OverwriteAsNeeded 12,559 System 15,360 0 OverwriteAsNeeded 11,173 Windows PowerShell ## Get-EventSubscriber DESCRIPTION The Get-EventSubscriber cmdlet gets the event subscribers in the current session. EXAMPLE$Timer = New-Object Timers.Timer
$Timer | Get-Member -Type Event OUTPUT TypeName: System.Timers.Timer Name MemberType Definition ---- ---------- ---------- Disposed Event System.EventHandler Disposed(System.Object, System.EventArgs) Elapsed Event System.Timers.ElapsedEventHandler Elapsed(System.Object, System.Timers.ElapsedEventArgs) EXAMPLE Register-ObjectEvent -InputObject$Timer -EventName Elapsed -SourceIdentifier Timer.Elapsed
Get-EventSubscriber

OUTPUT

SubscriptionId : 4
SourceObject : System.Timers.Timer
EventName : Elapsed
SourceIdentifier : Timer.Elapsed
Action :
HandlerDelegate :
SupportEvent : False
ForwardEvent : False

## Get-FileHash

DESCRIPTION

The Get-FileHash cmdlet computes the hash value for a file by using a specified hash algorithm. A hash value is a unique value that corresponds to the content of the file. Rather than identifying the contents of a file by its file name, extension, or other designation, a hash assigns a unique value to the contents of a file. File names and extensions can be changed without altering the content of the file, and without changing the hash value. Similarly, the file's content can be changed without changing the name or extension. However, changing even a single character in the contents of a file changes the hash value of the file.

EXAMPLE

Get-FileHash /etc/apt/sources.list | Format-List

OUTPUT

Algorithm : SHA256
Hash : 3CBCFDDEC145E3382D592266BE193E5BE53443138EE6AB6CA09FF20DF609E268
Path : /etc/apt/sources.list

## Get-FormatData

DESCRIPTION

The Get-FormatData cmdlet gets the formatting data in the current session.

OUTPUT

Count Name
----- ----
365 .xml
231 .cdxml
197
169 .ps1xml
142 .txt
114 .psd1
63 .psm1
49 .xsd
36 .dll
15 .mfl
15 .mof

## Import-Alias

DESCRIPTION

The Import-Alias cmdlet imports an alias list from a file.

Beginning in Windows PowerShell 3.0, as a security feature, Import-Alias does not overwrite existing aliases by default. To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the Force parameter.

EXAMPLE

Import-Alias test.txt

## Import-Clixml

DESCRIPTION

The Import-Clixml cmdlet imports a Common Language Infrastructure (CLI) XML file with data that represents Microsoft .NET Framework objects and creates the PowerShell objects. For more information about CLI, see Language independence.

EXAMPLE

Get-Process | Export-Clixml -Path .\pi.xml

## Measure-Command

DESCRIPTION

The Measure-Command cmdlet runs a script block or cmdlet internally, times the execution of the operation, and returns the execution time.

EXAMPLE

Measure-Command { Get-ChildItem -Path C:\Windows\*.txt -Recurse }

OUTPUT

Days : 0
Hours : 0
Minutes : 0
Seconds : 8
Milliseconds : 618
Ticks : 86182763
TotalDays : 9.9748568287037E-05
TotalHours : 0.00239396563888889
TotalMinutes : 0.143637938333333
TotalSeconds : 8.6182763
TotalMilliseconds : 8618.2763

## Measure-Object

DESCRIPTION

The Measure-Object cmdlet calculates the property values of certain types of object. Measure-Object performs three types of measurements, depending on the parameters in the command.

The Measure-Object cmdlet performs calculations on the property values of objects. You can use Measure-Object to count objects or count objects with a specified Property. You can also use Measure-Object to calculate the Minimum, Maximum, Sum, StandardDeviation and Average of numeric values. For String objects, you can also use Measure-Object to count the number of lines, words, and characters.

EXAMPLE

"One", "Two", "Three", "Four" | Set-Content -Path C:\Temp\tmp.txt
Get-Content C:\Temp\tmp.txt | Measure-Object -Character -Line -Word

OUTPUT

Lines Words Characters Property
----- ----- ---------- --------
4 4 15

## New-Alias

DESCRIPTION

The New-Alias cmdlet creates a new alias in the current PowerShell session. Aliases created by using New-Alias are not saved after you exit the session or close PowerShell. You can use the Export-Alias cmdlet to save your alias information to a file. You can later use Import-Alias to retrieve that saved alias information.

EXAMPLE

New-Alias -Name "List" Get-ChildItem

## New-Event

DESCRIPTION

The New-Event cmdlet creates a new custom event.

You can use custom events to notify users about state changes in your program and any change that your program can detect, including hardware or system conditions, application status, disk status, network status, or the completion of a background job.

EXAMPLE

New-Event -SourceIdentifier Timer -Sender windows.timer -MessageData "Test"

## New-Guid

DESCRIPTION

The New-Guid cmdlet creates a random globally unique identifier (GUID). If you need a unique ID in a script, you can create a GUID, as needed.

EXAMPLE

New-Guid

## New-Object

DESCRIPTION

The New-Object cmdlet creates an instance of a .NET Framework or COM object.

You can specify either the type of a .NET Framework class or a ProgID of a COM object. By default, you type the fully qualified name of a .NET Framework class and the cmdlet returns a reference to an instance of that class. To create an instance of a COM object, use the ComObject parameter and specify the ProgID of the object as its value.

EXAMPLE

New-Object -TypeName System.Version -ArgumentList "1.2.3.4"

More Examples Here

OUTPUT

Major Minor Build Revision
----- ----- ----- --------
1 2 3 4

## New-TemporaryFile

DESCRIPTION

This cmdlet creates temporary files that you can use in scripts.

The New-TemporaryFile cmdlet creates an empty file that has the .tmp file name extension. This cmdlet names the file tmp<NNNN>.tmp, where <NNNN> is a random hexadecimal number. The cmdlet creates the file in your TEMP folder.

EXAMPLE

$TimeSpan OUTPUT Days : 0 Hours : 1 Minutes : 25 Seconds : 0 Milliseconds : 0 Ticks : 51000000000 TotalDays : 0.0590277777777778 TotalHours : 1.41666666666667 TotalMinutes : 85 TotalSeconds : 5100 TotalMilliseconds : 5100000 ## New-Variable DESCRIPTION The New-Variable cmdlet creates a new variable in Windows PowerShell. You can assign a value to the variable while creating it or assign or change the value after it is created. You can use the parameters of New-Variable to set the properties of the variable, set the scope of a variable, and determine whether variables are public or private. Typically, you create a new variable by typing the variable name and its value, such as$Var = 3, but you can use the New-Variable cmdlet to use its parameters.

EXAMPLE

New-Variable -Name "zipcode" -Value 98033

## Out-File

DESCRIPTION

The Out-File cmdlet sends output to a file. It implicitly uses PowerShell's formatting system to write to the file. The file receives the same display representation as the terminal. This means that the output may not be ideal for programmatic processing unless all input objects are strings. When you need to specify parameters for the output, use Out-File rather than the redirection operator (>). For more information about redirection, see about_Redirection.

EXAMPLE

Get-Process | Out-File -FilePath .\Process.txt
Get-Content -Path .\Process.txt

OUTPUT

NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
------ ----- ----- ------ -- -- -----------
29 22.39 35.40 10.98 42764 9 Application
53 99.04 113.96 0.00 32664 0 CcmExec
27 96.62 112.43 113.00 17720 9 Code

## Out-GridView

DESCRIPTION

The Out-GridView cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table.

EXAMPLE

Get-Process | Out-GridView

## Out-Printer

DESCRIPTION

The Out-Printer cmdlet sends output to the default printer or to an alternate printer, if one is specified.

EXAMPLE

## Out-String

DESCRIPTION

The Out-String cmdlet converts input objects into strings. By default, Out-String accumulates the strings and returns them as a single string, but you can use the Stream parameter to direct Out-String to return one line at a time or create an array of strings. This cmdlet lets you search and manipulate string output as you would in traditional shells when object manipulation is less convenient.

This sometimes work better that ".ToString()"

EXAMPLE

Get-Content C:\Temp\File.txt | Out-String

If multiple lines are pulled from the test file, it makes the object a string instead of an object that still needs to be converted.

DESCRIPTION

The Read-Host cmdlet reads a line of input from the console (stdin). You can use it to prompt a user for input. Because you can save the input as a secure string, you can use this cmdlet to prompt users for secure data, such as passwords.

EXAMPLE

## Register-ObjectEvent

DESCRIPTION

The Register-ObjectEvent cmdlet subscribes to events that are generated by .NET objects on the local computer or on a remote computer.

EXAMPLE

$queryParameters = '__InstanceCreationEvent', (New-Object TimeSpan 0,0,1), "TargetInstance isa 'Win32_Process'"$Query = New-Object System.Management.WqlEventQuery -ArgumentList $queryParameters$ProcessWatcher = New-Object System.Management.ManagementEventWatcher $Query Register-ObjectEvent -InputObject$ProcessWatcher -EventName "EventArrived"

## Remove-Event

DESCRIPTION

The Remove-Event cmdlet deletes events from the event queue in the current session.
This cmdlet deletes only the events currently in the queue. To cancel event registrations or unsubscribe, use the Unregister-Event cmdlet.

EXAMPLE

Remove-Event -SourceIdentifier "ProcessStarted"

## Remove-PSBreakpoint

DESCRIPTION

The Remove-PSBreakpoint cmdlet deletes a breakpoint. Enter a breakpoint object or a breakpoint ID.

When you remove a breakpoint, the breakpoint object is no longer available or functional. If you have saved a breakpoint object in a variable, the reference still exists, but the breakpoint does not function.

EXAMPLE

Get-PSBreakpoint | Remove-PSBreakpoint

## Remove-TypeData

DESCRIPTION

The Remove-TypeData cmdlet deletes extended type data from the current session. This cmdlet affects only the current session and sessions that are created in the current session.

EXAMPLE

Remove-TypeData -TypeName System.Array

## Remove-Variable

DESCRIPTION

The Remove-Variable cmdlet deletes a variable and its value from the scope in which it is defined, such as the current session. You cannot use this cmdlet to delete variables that are set as constants or those that are owned by the system.

EXAMPLE

$Processes = Get-Process Remove-Variable Processes ## Select-Object DESCRIPTION The Select-Object cmdlet selects specified properties of an object or set of objects. It can also select unique objects, a specified number of objects, or objects in a specified position in an array. EXAMPLE Get-Process | Select-Object -Property ProcessName, Id, WS ## Select-String DESCRIPTION The Select-String cmdlet uses regular expression matching to search for text patterns in input strings and files. You can use Select-String similar to grep in UNIX or findstr.exe in Windows. EXAMPLE 'Hello', 'HELLO' | Select-String -Pattern 'HELLO' -CaseSensitive -SimpleMatch ## Select-Xml DESCRIPTION The Select-Xml cmdlet lets you use XPath queries to search for text in XML strings and documents. Enter an XPath query, and use the Content, Path, or Xml parameter to specify the XML to be searched. EXAMPLE$Path = "$Pshome\Types.ps1xml"$XPath = "/Types/Type/Members/AliasProperty"
Select-Xml -Path $Path -XPath$Xpath | Select-Object -ExpandProperty Node

OUTPUT

Name ReferencedMemberName
---- --------------------
Count Length
Name Key
Name ServiceName
RequiredServices ServicesDependedOn
ProcessName Name
Handles Handlecount
VM VirtualSize
WS WorkingSetSize
Name ProcessName
Handles Handlecount
VM VirtualMemorySize
WS WorkingSet
PM PagedMemorySize
NPM NonpagedSystemMemorySize
Name __Class
Namespace ModuleName

## Send-MailMessage

DESCRIPTION

The Send-MailMessage cmdlet sends an email message from within PowerShell.

You must specify a Simple Mail Transfer Protocol (SMTP) server or the Send-MailMessage command fails. Use the SmtpServer parameter or set the $PSEmailServer variable to a valid SMTP server. The value assigned to $PSEmailServer is the default SMTP setting for PowerShell. For more information, see about_Preference_Variables.

EXAMPLE

Send-MailMessage -From 'User01 <user01@fabrikam.com>' -To 'User02 <user02@fabrikam.com>', 'User03 <user03@fabrikam.com>' -Subject 'Sending the Attachment' -Body "Forgot to send the attachment. Sending now." -Attachments .\data.csv -Priority High -DeliveryNotificationOption OnSuccess, OnFailure -SmtpServer 'smtp.fabrikam.com'

## Set-Alias

DESCRIPTION

The Set-Alias cmdlet creates or changes an alias for a cmdlet or a command, such as a function, script, file, or other executable. An alias is an alternate name that refers to a cmdlet or command. For example, sal is the alias for the Set-Alias cmdlet. For more information, see about_Aliases.

EXAMPLE

Set-Alias -Name list -Value Get-ChildItem

## Set-Date

DESCRIPTION

The Set-Date cmdlet changes the system date and time on the computer to a date and time that you specify. You can specify a new date and/or time by typing a string or by passing a DateTime or TimeSpan object to Set-Date. To specify a new date or time, use the Date parameter. To specify a change interval, use the Adjust parameter.

EXAMPLE

## Set-PSBreakpoint

DESCRIPTION

The Set-PSBreakpoint cmdlet sets a breakpoint in a script or in any command run in the current session. You can use Set-PSBreakpoint to set a breakpoint before executing a script or running a command, or during debugging, when stopped at another breakpoint.

EXAMPLE

Set-PSBreakpoint -Script "sample.ps1" -Line 5

## Set-TraceSource

DESCRIPTION

The Set-TraceSource cmdlet configures, starts, and stops a trace of a PowerShell component. You can use it to specify which components will be traced and where the tracing output is sent.

EXAMPLE

Set-TraceSource -Name "ParameterBinding" -Option ExecutionFlow -PSHost -ListenerOption "ProcessId,TimeStamp"

## Set-Variable

DESCRIPTION

The Set-Variable cmdlet assigns a value to a specified variable or changes the current value. If the variable does not exist, the cmdlet creates it.

EXAMPLE

Set-Variable -Name "desc" -Value "A description"
Get-Variable -Name "desc"

OUTPUT

Name Value
---- -----
desc A description

## Show-Command

DESCRIPTION

The Show-Command cmdlet lets you create a PowerShell command in a command window. You can use the features of the command window to run the command or have it return the command to you.

EXAMPLE

Show-Command -Name "Invoke-Command"

## Sort-Object

DESCRIPTION

The Sort-Object cmdlet sorts objects in ascending or descending order based on object property values. If sort properties are not included in a command, PowerShell uses default sort properties of the first input object. If the type of the input object has no default sort properties, PowerShell attempts to compare the objects themselves. For more information, see the Notes section.

EXAMPLE
Sort by Size

Get-ChildItem -Path C:\Test -File | Sort-Object -Property Length

OUTPUT

Directory: C:\Test

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2/13/2019 13:26 20 Bfile.txt
-a---- 2/12/2019 16:24 23 Zsystemlog.log
-a---- 2/13/2019 08:55 26 anotherfile.txt
-a---- 2/1/2019 08:43 183 CreateTestFile.ps1
-a---- 2/12/2019 15:40 118014 Command.txt

## Start-Sleep

DESCRIPTION

The Start-Sleep cmdlet suspends the activity in a script or session for the specified period of time. You can use it for many tasks, such as waiting for an operation to complete or pausing before repeating an operation.

EXAMPLE

Start-Sleep -s 15

## Tee-Object

DESCRIPTION

The Tee-Object cmdlet redirects output, that is, it sends the output of a command in two directions (like the letter T). It stores the output in a file or variable and also sends it down the pipeline. If Tee-Object is the last command in the pipeline, the command output is displayed at the prompt.

EXAMPLE

Get-Process | Tee-Object -FilePath "C:\Test1\testfile2.txt"

OUTPUT

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
83 4 2300 4520 39 0.30 4032 00THotkey
272 6 1400 3944 34 0.06 3088 alg
81 3 804 3284 21 2.45 148 ApntEx
81 4 2008 5808 38 0.75 3684 Apoint
...

## Trace-Command

DESCRIPTION

The Trace-Command cmdlet configures and starts a trace of the specified expression or command. It works like Set-TraceSource, except that it applies only to the specified command.

EXAMPLE

## Unblock-File

DESCRIPTION

The Unblock-File cmdlet lets you open files that were downloaded from the Internet. It unblocks PowerShell script files that were downloaded from the Internet so you can run them, even when the PowerShell execution policy is RemoteSigned. By default, these files are blocked to protect the computer from untrusted files.

EXAMPLE

## Unregister-Event

DESCRIPTION

The Unregister-Event cmdlet cancels an event subscription that was created by using the Register-EngineEvent, Register-ObjectEvent, or Register-WmiEvent cmdlet.

EXAMPLE

Unregister-Event -SourceIdentifier "ProcessStarted"

## Update-FormatData

DESCRIPTION

The Update-FormatData cmdlet reloads the formatting data from formatting files into the current session. This cmdlet lets you update the formatting data without restarting PowerShell.

Without parameters, Update-FormatData reloads the formatting files that it loaded previously. You can use the parameters of Update-FormatData to add new formatting files to the session.

EXAMPLE

Update-FormatData -AppendPath "trace.format.ps1xml, log.format.ps1xml"

## Update-List

DESCRIPTION

The Update-List cmdlet adds, removes, or replaces items in a property value of an object and returns the updated object. This cmdlet is designed for properties that contain collections of objects.

The Add and Remove parameters add individual items to and remove them from the collection.

EXAMPLE

Examples are quite lengthy. See them here

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/update-list

## Update-TypeData

DESCRIPTION

The Update-TypeData cmdlet updates the extended type data in the session by reloading the Types.ps1xml files into memory and adding new extended type data.

EXAMPLE

Update-TypeData -PrependPath TypesA.types.ps1xml, TypesB.types.ps1xml
Update-TypeData -PrependPath TypesA.types.ps1xml

## Wait-Debugger

DESCRIPTION

Stops the PowerShell script execution engine at the point immediately after the Wait-Debugger cmdlet and waits for a debugger to be attached. This is similar to using Enable-RunspaceDebug -BreakAll in a DSC resource but breaks at a specific point in the script.

Make sure you remove the Wait-Debugger lines after you are done. A running script appears to be hung when it is stopped at a Wait-Debugger.

EXAMPLE

Examples are quite lengthy. See them here.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/wait-debugger?view=powershell-7.2

## Wait-Event

DESCRIPTION

The Wait-Event cmdlet suspends execution of a script or function until a particular event is raised. Execution resumes when the event is detected. To cancel the wait, press CTRL+C.

EXAMPLE

Wait-Event -SourceIdentifier "ProcessStarted"

## Write-Debug

DESCRIPTION

The Write-Debug cmdlet writes debug messages to the host from a script or command.

EXAMPLE

Write-Debug "Cannot open file."

## Write-Error

DESCRIPTION

The Write-Error cmdlet declares a non-terminating error. By default, errors are sent in the error stream to the host program to be displayed, along with output.

EXAMPLE

## Write-Host

DESCRIPTION

The Write-Host cmdlet's primary purpose is to produce for-(host)-display-only output, such as printing colored text like when prompting the user for input in conjunction with Read-Host. Write-Host uses the ToString() method to write the output. By contrast, to output data to the pipeline, use Write-Output or implicit output.

EXAMPLE

Write-Host "no newline test " -NoNewline
Write-Host "second string"

OUTPUT

no newline test second string

## Write-Information

DESCRIPTION

The Write-Information cmdlet specifies how PowerShell handles information stream data for a command.

EXAMPLE

Write-Information -MessageData "Processes starting with 'P'" -InformationAction Continue
Get-Process -Name p*

OUTPUT

Processes starting with 'P'

18 19.76 15.16 0.00 6232 0 PFERemediation
20 8.92 25.15 0.00 24944 0 policyHost
9 1.77 7.64 0.00 1780 0 powercfg
10 26.67 32.18 0.00 7028 0 powercfg
8 26.55 31.59 0.00 13600 0 powercfg
9 1.66 7.55 0.00 22620 0 powercfg
21 6.17 4.54 202.20 12536 1 PowerMgr
42 84.26 12.71 2,488.84 20588 1 powershell
27 47.07 45.38 2.05 25988 1 powershell
27 24.45 5.31 0.00 12364 0 PresentationFontCache
92 112.04 13.36 82.30 13176 1 pwsh
106 163.73 93.21 302.25 14620 1 pwsh
227 764.01 92.16 1,757.22 25328 1 pwsh

## Write-Output

DESCRIPTION

Writes the specified objects to the pipeline. If Write-Output is the last command in the pipeline, the objects are displayed in the console.

EXAMPLE

$P = Get-Process Write-Output$P

## Write-Progress

DESCRIPTION

The Write-Progress cmdlet displays a progress bar in a PowerShell command window that depicts the status of a running command or script. You can select the indicators that the bar reflects and the text that appears above and below the progress bar.

EXAMPLE

for ($i = 1;$i -le 100; $i++ ) { Write-Progress -Activity "Search in Progress" -Status "$i% Complete:" -PercentComplete $i Start-Sleep -Milliseconds 250 } ## Write-Verbose DESCRIPTION The Write-Verbose cmdlet writes text to the verbose message stream in PowerShell. Typically, the verbose message stream is used to deliver more in depth information about command processing. EXAMPLE Write-Verbose -Message "Searching the Application Event Log." Write-Verbose -Message "Searching the Application Event Log." -Verbose ## Write-Warning DESCRIPTION The Write-Warning cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's$WarningPreference variable and the use of the WarningAction common parameter.

EXAMPLE

Write-Warning "This is only a test warning."

Source : Microsoft.com

﻿CHECK OUT OUR FREE AND PREMIUM TOOLS HERE