since i start read & learn about PS i didn't understand things too much ... the basic things, missing function, variables until I read this article about Get-Member thing Get-Member Gets the properties and methods of objects. https://learn.microsoft.com/en-us/p...rshell.utility/get-member?view=powershell-5.1 so basically, instead of breaking your head how to get information from function you only type this, and 90% its done Code: @(Func) | get-member so i break my f* head how to get file version information spend f* few hours, and by check with get-member just found out - .VersionInfo option -> .FileVersion is available no -> select .. | select | more s**t .. only short line like this Code: @(Get-ItemProperty -lit @(Join-Path -Path $env:ProgramFiles -ChildPath 'myapp\myapp.exe')).VersionInfo.FileVersion Another example get-service | get-member you have property -> Name so instead of -> | select Name we can do this -> @(get-service).Name
some other useful articles that you can check in your spare time about Logical Operators https://learn.microsoft.com/en-us/p...t/about_logical_operators?view=powershell-7.2 about Comparison Operators https://learn.microsoft.com/en-us/p...bout_comparison_operators?view=powershell-7.2 Using Format Commands to Change Output View https://learn.microsoft.com/en-us/p...nds-to-change-output-view?view=powershell-7.2 about Special Characters https://learn.microsoft.com/en-us/p.../about_special_characters?view=powershell-7.2
Dark Why doing so much hard work as you can simply use short code + Alias for full Func : Code: Powershell -C "(GP '%ProgramFiles%\7-Zip\7zFM.exe').VersionInfo.FileVersion" i do use this : Code: echo 7-Zip Version & Powershell -C "(GP '%ProgramFiles%\7-Zip\7zFM.exe').VersionInfo.FileVersion"
Hmm OK you dont have to go that much far : Powershell -C "Get-Help Function-You-Query-For" thats all . suppose Powershell -C "Get-Help Get-ItemProperty" will result : Code: NAME Get-ItemProperty SYNTAX Get-ItemProperty [-Path] <string[]> [[-Name] <string[]>] [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>] Get-ItemProperty [[-Name] <string[]>] -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>] ALIASES gp