Pages

Thursday, November 10, 2016

PowerShell - hints

Display table of PowerShell and subcomponents versions

  • $PSVersionTable

PowerShell ExecutionPolicy Execution Policy

  • For Remote Signed, run Set-ExecutionPolicy RemoteSigned
  • For Unrestricted, run Set-ExecutionPolicy Unrestricted


List all object properties
  • get-vmhost -name esx02.home.uw.cz | Format-List -Property * 

Measure-object .... sum, avg, etc. from objects in pipeline

Get-member ... get info about objects in pipeline. All Properties are displayed.

Select-object ... https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/select-object

Sort-Object ... sort objects in the pipeline