Tobias Simetsreiter 2 жил өмнө
parent
commit
47920c4dfb

+ 3 - 2
bin/Invoke-Script.ps1

@@ -1,8 +1,9 @@
 param(
     $Script,
-    $ComputerName
+    $ComputerName,
+    $ArgumentList = @()
 )
 
 $source = Get-Command $Script  | Select-Object -ExpandProperty ScriptBlock
 
-Invoke-Command -ScriptBlock $source -ComputerName $ComputerName
+Invoke-Command -ScriptBlock $source -ComputerName $ComputerName -ArgumentList $ArgumentList

+ 4 - 0
bin/Set-AutoLogin.ps1

@@ -17,6 +17,10 @@ if ($null -eq $Username){
     $Username = Read-Host 'Enter username for auto-logon (f.e. contoso\user1)'
 }
 
+if ("" -eq $Username) {
+    throw "Username is Empty!"
+}
+
 if ($null -eq $Pass){
     $Pass = Read-Host "Enter password for $Username"
 }