3 ms·
Honest question: How do you do discovery on PowerShell objects? That is, with the Unix approach, when I'm trying to do something ad hoc I can do one step of a
by AnimalMuppet 3y ago
Honest question: How do you do discovery on PowerShell objects?
That is, with the Unix approach, when I'm trying to do something ad hoc I can do one step of a pipe, read the results on the terminal, see what the format is, and figure out how I have to set up the next step of the pipe. How do I do that with PowerShell?
- dale_glass 3y agoPipe it through Format-List: C:\Windows> Get-Item .\explorer.exe | Format-List This gives you the generally useful view of what Get-Item returned. You can ask to see everything with: C:\Windows> Get-Item .\explorer.exe | Format-List -Property * Tab completion also completes these. Some of what you get can be subdivided further if you look, eg: C:\Windows> (Get-Item .\explorer.exe).VersionInfo.FileVersionRaw | Format-List -Property *
- majkinetor 3y agoUse Get-Member. For example, to find all available properties of the service object: Get-Service | Get-Member Also, Format-List and ConvertTo-Json can show you a lot of details