mkellerman / Invoke-CommandAs

Invoke Command As System/Interactive/GMSA/User on Local/Remote machine & returns PSObjects.

Home Page:https://www.powershellgallery.com/packages/Invoke-CommandAs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

One liner in README still seems to have trouble

bulanula opened this issue · comments

Hi,

Thanks for closing #19. Not sure what the etiquette with this is, please let me know if it would have been better to make a comment on the old issue rather than opening this new one.

However, I'm still having trouble getting the one liner ((New-Object Net.WebClient).DownloadString("https://raw.githubusercontent.com/mkellerman/Invoke-CommandAs/master/Scripts/Invoke-CommandAs.ps1") | iex) to work well, as the screenshot below shows:

image

Many thanks for your help with this, much appreciated !

I really want this to work for you, but it's a lot of work.. lol.

If anyone know an easy way to make a multiple file ps1 module, and yet, produce a single ps1 for fast single file import, let me know.

I have updated it to work with 2 OneLiners.. lol.. best i could do for now!

Improved it to be only 1 line, and removed the Invoke-Expression, which can be blocked on most environments.

"Public/Invoke-CommandAs.ps1", "Private/Invoke-ScheduledTask.ps1" | % {
    . ([ScriptBlock]::Create((New-Object Net.WebClient).DownloadString("https://raw.githubusercontent.com/mkellerman/Invoke-CommandAs/master/Invoke-CommandAs/${_}")))
}