PatrickHiggins607207

How to use powershell in backend variable?

Discussion created by PatrickHiggins607207 on Nov 20, 2017
Latest reply on Nov 21, 2017 by PatrickHiggins607207
I have been trying to use Windows powershell to get the first (or nth) line out of a file.
Something like:
cmd /c PS C:\> Invoke-Command Get-Content  "c:\uc4\agents\windows\bin\UCXJWX6.ini" | select -First 1
/c PS C:\> Invoke-Command Get-Content  "c:\uc4\agents\windows\bin\UCXJWX6.ini" | select -First 1
PS C:\> Invoke-Command Get-Content  "c:\uc4\agents\windows\bin\UCXJWX6.ini" | select -First 1

These are all failing.

This gets close, but I have not found a way to get windows to only return the nth line---This lists only those lines with 'log' in the line.    
cmd /c type  c:\uc4\agents\windows\bin\UCXJWX6.ini  | find "log" |  more

Outcomes