Reputation: 11
I am creating a script that will check if a file is in the downloads folder, silently install if found or silently download if not found.
Steps:
I am not sure how to silently perform the above, I keep getting a window that pops up showing the download. Here is my script, I am a beginner with PS so go easy on me
if ( Get-ChildItem -Path C:\Users\*\Downloads\7z1900.exe )
{
7z1900.exe /install /norestart /quiet
}
else {
start /quiet "https://www.7-zip.org/a/7z1900.exe"
}
Upvotes: 1
Views: 2298
Reputation: 869
How about using curl
cmdlet?
curl http://some.url --output some.file
Or in your case
curl https://7-zip.org/a/7z1900-x64.msi --output 7z1900-x64.msi
Followed by
7z1900-x64.msi /quiet
(I have used the *.msi file, since the exe does not seem to support a silent installation)
Upvotes: 1