Created
May 16, 2016 18:30
-
-
Save NicholasLeader/a35bcdea1cf1df1c8bb6a37976edfe7c to your computer and use it in GitHub Desktop.
PowerShell .NET example using inline .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Nicholas Leader | |
05/16/2016 | |
Quick example .NET | |
This is one of the things that makes PowerShell extensible - you can do inline .NET | |
Reference: https://blogs.technet.microsoft.com/heyscriptingguy/2010/10/26/learn-how-to-use-net-framework-commands-inside-windows-powershell/ | |
#> | |
# using the System.Diagnostics.Process .NET class to grab the local processes | |
[diagnostics.process]::GetProcesses() | | |
# piping output to the 'sort-object' PowerShell cmdlet, then sorting on 'processName' descending | |
Sort-Object -Property ProcessName -Descending |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment