This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
userspace:windows_updates_-_powershell [2017/03/02 09:41] trabs-ol |
userspace:windows_updates_-_powershell [2021/08/23 08:37] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Mit diesem Script werden so lange Updates | + | ====== WSUS Updates |
- | Voraussetzungen: | + | Mit diesem Script werden so lange Updates intstalliert bis keine mehr vorliegen. Die Updates werden nur nach 19 Uhr und vor 7 Uhr installiert um den User nicht an der Anmeldung zu hindern. Aussnahme: Der Rechner wurde neu installiert, |
+ | |||
+ | Voraussetzungen: | ||
+ | |||
+ | Getestet unter Windows 7 x64 SP1 | ||
+ | |||
+ | Logging des Scriptes erfolgt in C: | ||
+ | |||
+ | Ordnerstruktur: | ||
+ | |||
+ | CLIENT_DATA | ||
+ | * install-updates.ps1 | ||
+ | * install-updates-once.ps1 | ||
+ | * once64.ins | ||
+ | * setup64.ins | ||
+ | * windows_update_icon.png (nur fürs gute Aussehen) | ||
+ | |||
+ | OPSI | ||
+ | * control | ||
setup64.ins | setup64.ins | ||
Line 21: | Line 39: | ||
DefVar $MinimumSpace$ | DefVar $MinimumSpace$ | ||
DefVar $ExitCode$ | DefVar $ExitCode$ | ||
- | |||
- | DefStringList $Version_List$ | ||
- | DefVar $Version$ | ||
Set $LogDir$ = " | Set $LogDir$ = " | ||
Line 45: | Line 60: | ||
ShowBitmap " | ShowBitmap " | ||
- | Message " | + | |
- | set $Version_List$ = getOutStreamFromSection (" | + | |
- | set $Version$ = takeString(2, | + | |
- | + | ||
- | if ($Version$ < " | + | |
- | Message " | + | |
- | opsiServiceCall_Powershell_Setup | + | |
- | Message " | + | |
- | ExitWindows / | + | |
- | else | + | |
- | Message " | + | |
- | endif | + | |
- | + | ||
- | | + | |
Message " | Message " | ||
DosInAnIcon_WindowsUpate | DosInAnIcon_WindowsUpate | ||
Line 64: | Line 66: | ||
endif | endif | ||
- | |||
- | [DosInAnIcon_PSVersion_check] | ||
- | powershell.exe $PSVersionTable.PSVersion.Major | ||
[Files_Install] | [Files_Install] | ||
CheckTargetPath = " | CheckTargetPath = " | ||
- | copy -u " | + | copy -u " |
[DosInAnIcon_WindowsUpate] | [DosInAnIcon_WindowsUpate] | ||
- | " | + | " |
- | + | ||
- | [opsiServiceCall_Powershell_Setup] | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | ] | + | |
[Sub_check_exitcode] | [Sub_check_exitcode] | ||
Line 131: | Line 122: | ||
DefVar $MinimumSpace$ | DefVar $MinimumSpace$ | ||
DefVar $ExitCode$ | DefVar $ExitCode$ | ||
- | |||
- | DefStringList $Version_List$ | ||
- | DefVar $Version$ | ||
Set $LogDir$ = " | Set $LogDir$ = " | ||
Line 155: | Line 143: | ||
ShowBitmap " | ShowBitmap " | ||
- | Message " | + | |
- | set $Version_List$ = getOutStreamFromSection (" | + | |
- | set $Version$ = takeString(2, | + | |
- | + | ||
- | if ($Version$ < " | + | |
- | Message " | + | |
- | opsiServiceCall_Powershell_Setup | + | |
- | Message " | + | |
- | ExitWindows / | + | |
- | else | + | |
- | Message " | + | |
- | endif | + | |
- | + | ||
- | | + | |
Message " | Message " | ||
DosInAnIcon_WindowsUpate | DosInAnIcon_WindowsUpate | ||
Line 174: | Line 149: | ||
endif | endif | ||
- | |||
- | [DosInAnIcon_PSVersion_check] | ||
- | powershell.exe $PSVersionTable.PSVersion.Major | ||
[Files_Install] | [Files_Install] | ||
CheckTargetPath = " | CheckTargetPath = " | ||
- | copy -u " | + | copy -u " |
[DosInAnIcon_WindowsUpate] | [DosInAnIcon_WindowsUpate] | ||
- | " | + | " |
- | + | ||
- | [opsiServiceCall_Powershell_Setup] | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | ] | + | |
[Sub_check_exitcode] | [Sub_check_exitcode] | ||
Line 249: | Line 213: | ||
customScript: | customScript: | ||
userLoginScript: | userLoginScript: | ||
- | |||
- | [ProductDependency] | ||
- | action: setup | ||
- | requiredProduct: | ||
- | requiredStatus: | ||
- | requirementType: | ||
</ | </ | ||
Line 334: | Line 292: | ||
- | $LogPath = 'C: | + | $LogPath = "$env:SystemDrive\tmp\windows-update-opsi.log" |
$FirstRun = Test-Path -Path $LogPath | $FirstRun = Test-Path -Path $LogPath | ||
Line 577: | Line 535: | ||
- | $LogPath = 'C: | + | $LogPath = "$env:SystemDrive\tmp\windows-update-opsi.log" |
$FirstRun = Test-Path -Path $LogPath | $FirstRun = Test-Path -Path $LogPath | ||
Line 744: | Line 702: | ||
</ | </ | ||
- | < | ||
- | </ | ||
- | |||
- | < | ||
- | </ |