mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.
https://www.powershellgallery.com/packages/Invoke-CommandAs/
MIT License
455 stars 71 forks source link

parsing error when using -FilePath #59

Closed kkawabanga closed 2 years ago

kkawabanga commented 2 years ago

https://github.com/mkellerman/Invoke-CommandAs/blob/222657169a66dc9f02edf707cb86e38a27e25f20/Invoke-CommandAs/Public/Invoke-CommandAs.ps1#L313

use "-raw" switch, otherwise "get-content" removes newline-characters from the scriptfile on import.

->

Line 313: $ScriptContent = Get-Content -Path $FilePath -Raw

mkellerman commented 2 years ago

Thank you. Do you wish to create the PR and I merge it in? Let me know, or I'll go right ahead and make the changes.

kkawabanga commented 2 years ago

Pull request is ready to merge

mkellerman commented 2 years ago

60 has been merge! thank you for your contribution!