I create a PS script that won't run on my workstation, nothing happens. After investigation the script download the EXE file but the installation next runs or executes.
Not sure if this is permission issue or a scripting error? Please help me. Below is my current script
I create a PS script that won't run on my workstation, nothing happens. After investigation the script download the EXE file but the installation next runs or executes.
Not sure if this is permission issue or a scripting error? Please help me. Below is my current script
# Silent Install Dropbox
# Download URL: https://vbc-downloads.vonage.com/win/VonageBusinessSetup.exe
# Path for the workdir
$workdir = "c:\temp\Vonage"
# Check if work directory exists if not create it
If (Test-Path -Path $workdir -PathType Container)
{ Write-Host "$workdir already exists" -ForegroundColor Red}
ELSE
{ New-Item -Path $workdir -ItemType directory }
# Download the installer
$source = "https://vbc-downloads.vonage.com/win/VonageBusinessSetup.exe"
$destination = "$workdir\VonageBusinessSetup.exe"
Invoke-WebRequest $source -OutFile $destination
# Wait 60 Seconds for the installer to download
Start-Sleep -s 60
# Start the installation
Start-Process -FilePath "$workdir\VonageBusinessSetup.exe" -ArgumentList "/S"
# Wait XX Seconds for the installation to finish
Start-Sleep -s 60
Edited by Gregory Candido