I'm trying to split a list of name properties after the verb/hyphen and got it to work but I had to save to a file first.
I got it to work like this - Grab the Name properties and add them to a file -
Get-Command -Module Posh-SSH | Format-Table Name | out-file posh_ssh
then split list at the '-'
Get-Content .\posh_ssh | % {$_.split("-")[1]}
But is there a way to do it on one line like this? I don't understand why this didn't work.
Get-Command -Module Posh-SSH | Format-Table Name | % {$_.split("-")[1]}
Thanks!