Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #.foo.ps1
- [String]$UserName = $args[0]
- [String]$Password = $args[1]
- [String[]] $ComputerName = $args[2]
- [String[]] $Users = $args[3]
- Write-Output "Username is $UserName"
- Write-Output "Password is $Password"
- foreach ($Computer in $ComputerName) {
- Write-Output "Computer is $Computer"
- }
- foreach ($User in $Users) {
- Write-Output "Users is $User"
- }
- PS dir>powershell -executionpolicy bypass -Command .foo.ps1 "my_username" "my_password" "Computer1, Computer2" "User1, User2"
- import subprocess
- process = subprocess.Popen(['powershell.exe',"""powershell -executionpolicy bypass -File Foo.ps1 "username" "password" "computer1,computer2" "user1,user2" """], stdin=subprocess.PIPE,stdout=subprocess.PIPE)
- print(process.communicate())
Add Comment
Please, Sign In to add comment