PowerShell icon indicating copy to clipboard operation
PowerShell copied to clipboard

Method invocation failed: System.Object does not contain 'Trim'

Open c-a-l-l-a-n opened this issue 5 years ago • 0 comments

I'm getting an error on one of the trims:

Method invocation failed because [System.Object[]] does not contain a method named 'Trim'. At line:190 char:5

190: $Output = (((((cmd.exe /c $Arguments | Where-Object { $_ -like "Enabled" } | Where-Object { $_ -notlike "example" }) -replace 'Enabled', '').Trim()) -replace '^\d+', '').Trim()) | ForEach-Object { ($_ -split ' {2,}')[1] }

c-a-l-l-a-n avatar Apr 07 '20 09:04 c-a-l-l-a-n