Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = $env:username
- $pass= $env:password | ConvertTo-SecureString -AsPlainText -Force
- $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $env:username, $pass
- Invoke-Command -ComputerName SomeServer -ScriptBlock {SomeDamnCode} -credential $cred
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement