r2d2r3po
Goto Top

Download via Powershell im Temp Variable

Hallo,

kann mir jemand helfen wie der Befehl aussehen muss um einen .EXE in das %TEMP% Verzeichnis abzulegen?

Bei diesem Befehl

$downloadLink = "https://gdata-a.akamaihd.net/Q/WEB/B2C/WEU/GDATA_INTERNETSECURITY_WEB_WEU.exe" $destinationPath = $env:"TEMP\GDATA_INTERNETSECURITY_WEB_WEU.exe"   

Bekomme ich diesen Fehler

16-10-2024_18-17-44

Nach dem Download möchte ich das Update von GDATA darüber starten
"%temp%\GDATA_INTERNETSECURITY_WEB_WEU.exe"/_QuietInstallation="true"/_IgnoreReboot="true"  

Gruß, Fred

Content-ID: 668817

Url: https://administrator.de/contentid/668817

Ausgedruckt am: 16.10.2024 um 20:10 Uhr

Ted555
Lösung Ted555 16.10.2024 aktualisiert um 18:33:43 Uhr
Goto Top
Wo hast du den Quatsch denn zusammenkopiert?? Wenn du zwei separate Zeilen ohne Semikolon hintereinander pratschst kein Wunder das du da nen Fehler kassierst... Und von selbst ohne Download-Anweisung lädt sich die Datei auch nicht herunter face-smile.
$downloadLink = "https://gdata-a.akamaihd.net/Q/WEB/B2C/WEU/GDATA_INTERNETSECURITY_WEB_WEU.exe"  
$destinationPath = joinpath $env:TEMP (split-path $downloadlink -Leaf)
Invoke-WebRequest -uri $downloadlink -outfile $destinationPath -ErrorAction Stop
if (Test-Path $destinationpath -PathType -Leaf){
    &$destinationPath /_QuietInstallation="true" /_IgnoreReboot="true"  
}

Vielleicht doch erst mal die Basics hier abfrühstücken.
https://learn.microsoft.com/de-de/powershell/scripting/learn/ps101/01-ge ...
r2d2r3po
r2d2r3po 16.10.2024 aktualisiert um 18:46:33 Uhr
Goto Top
$downloadLink = "https://gdata-a.akamaihd.net/Q/WEB/B2C/WEU/GDATA_INTERNETSECURITY_WEB_WEU.exe"
$destinationPath = "$env:TEMP\$(split-path $downloadlink -Leaf)"
Invoke-WebRequest -uri $downloadlink -outfile $destinationPath
&$destinationPath /_QuietInstallation="true" /_IgnoreReboot="true"

Danke Dir. Teste ich mal.

Edit:
geht. 1000 Dank