Good morning,
I am trying to install a driver on a remote system with powershell. If I run the command locally it works fine and installs the driver.
Start-Process -FilePath "C:\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE" -ArgumentList ('/q') -Wait -NoNewWindow
But once I wrapped with an Invoke-command it no longer works.
Invoke-Command -ComputerName $ComputerName -Credential (Get-Credential) -ScriptBlock { Start-Process -FilePath "C:\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE" -ArgumentList ('/q') -PassThru -Wait -NoNewWindow }
The cursor returns after only a few seconds and the driver does not install. I tired adding in a -credential (get-credential) and while it does ask for my credentials it still fails.
here is the full script with company and pc info removed.
function Install-Make_Model_Audio_Driver{
[CmdletBinding()]
param(
[Parameter(Mandatory=$True)]
[string[]]$ComputerName
)
Copy-Item -Path '\\PathToDriver\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE' -Destination "\\$ComputerName\C$\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE" -Verbose
Invoke-Command -ComputerName $ComputerName -Credential (Get-Credential) -ScriptBlock { Start-Process -FilePath "C:\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE" -ArgumentList ('/q') -PassThru -Wait -NoNewWindow }
Remove-Item -Path "\\$ComputerName\C$\Audio_Driver_T82DN_WN_1.0.54.0_A05.EXE"
}
Caveat, Our envoirment is completely locked down with numbers VLANS which requires me use invoke-command to run commands locally on systems as we will not allow all TCP needed.
I would appreciate any help this.
Thank you