more ps1 scripts

This commit is contained in:
Gramzon
2025-02-03 14:16:10 +01:00
parent 3f8a8fc637
commit 112f47e21e
4 changed files with 105 additions and 0 deletions
@@ -0,0 +1,20 @@
# Define the URL of the file to download
$fileURL = "https://www.7-zip.org/a/7z2409-x64.msi"
# Define the path to save the file
$destinationPath = "C:\shares\installfiles\7z2409-x64.msi"
# Define the remote server name
$remoteServerName = "srv1"
# Script block to download the file
$scriptBlock = {
param($fileURL, $destinationPath)
# Use invoke-webrequest to download the file
Invoke-WebRequest -Uri $fileURL -OutFile $destinationPath
Write-Host "File downloaded to $destinationPath"
}
# Execute the script block on the remote server
Invoke-Command -ComputerName $remoteServerName -ScriptBlock $scriptBlock -ArgumentList $fileURL, $destinationPath