I am trying to have a script that will install exe and msi files in silent mode, but it's opening the installers instead of running silently.
#network drive path
$nwDrivePath = "\\server\folder\" #"
#check if path is valid
if (test-path $nwDrivePath){
Set-Location $nwDrivePath
}
else{
#if path is not valid abort
Write-Output "No path found for $nwDrivePath"
Write-Output "Aborting script"
break script
}
#install .exe files
$allFiles = Get-ChildItem $nwDrivePath -Filter *.exe | ForEach {
Start-Process $_.Fullname -ArgumentList "/s"
}
#install .msi files
$allFiles = Get-ChildItem $nwDrivePath -Filter *.msi | ForEach {
Start-Process $_.Fullname -ArgumentList "/qn"
}