From 91ce4f5369b9ce4f06bb43d76b8935389e5d70bd Mon Sep 17 00:00:00 2001 From: Floris van Enter Date: Mon, 28 May 2018 15:06:24 +0200 Subject: [PATCH] Fixed typo in Invoke-RemoteScript() --- PowerShell/function_Invoke-RemoteScript.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/function_Invoke-RemoteScript.ps1 b/PowerShell/function_Invoke-RemoteScript.ps1 index 6a8eb8f..adb4d26 100644 --- a/PowerShell/function_Invoke-RemoteScript.ps1 +++ b/PowerShell/function_Invoke-RemoteScript.ps1 @@ -54,10 +54,10 @@ function Invoke-RemoteScript() { Write-Verbose "Connect with $computer" if(Test-Path Variable:\Credentials) { Write-Verbose "Connect with $credentials.Username" - Invoke-Command -ComputerName $Computer -FilePath $Scriptfile + Invoke-Command -ComputerName $Computer -FilePath $Scriptfile -Credential $credentials } else { Write-Verbose "Connect with Logged On User" - Invoke-Command -ComputerName $Computer -FilePath $Scriptfile -Credential $credentials + Invoke-Command -ComputerName $Computer -FilePath $Scriptfile } } Remove-Variable -Name Credentials