JustAGuy
JustAGuy

Reputation: 5941

Running Silent Installers as Jobs with Powershell

This works just fine:

Start-Job -Name notepadpp -ScriptBlock { c:\directory\install\npp.6.5.1.Installer.exe /S }

This however does NOT:

Start-Job -Name notepadpp -ScriptBlock { & "$using:pwd\install\npp.6.5.1.Installer.exe /S" }

What am I missing?

Upvotes: 0

Views: 152

Answers (2)

JustAGuy
JustAGuy

Reputation: 5941

Start-Job -Name notepadpp -ScriptBlock { & "$($using:pwd)\install\npp.6.5.1.Installer.exe" /S }

Upvotes: 0

Swoogan
Swoogan

Reputation: 5548

It should probably be

Start-Job -Name notepadpp -ScriptBlock { & "$($using:pwd)\install\npp.6.5.1.Installer.exe /S" }

Upvotes: 1

Related Questions