forked from proxb/PoshWSUS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-PSWSUSConfigUpdateFiles.ps1
48 lines (40 loc) · 1.25 KB
/
Get-PSWSUSConfigUpdateFiles.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function Get-PSWSUSConfigUpdateFiles {
<#
.SYNOPSIS
Gets config whether updates are stored locally or whether clients download approved updates directly from Microsoft Update.
.DESCRIPTION
Gets config whether updates are stored locally or whether clients download approved updates directly from Microsoft Update.
.EXAMPLE
Get-PSWSUSConfigUpdateFiles
.OUTPUTS
Microsoft.UpdateServices.Internal.BaseApi.UpdateServerConfiguration
.NOTES
Name: Get-PSWSUSConfigUpdateFiles
Author: Dubinsky Evgeny
DateCreated: 1DEC2013
.LINK
http://blog.itstuff.in.ua/?p=62#Get-PSWSUSConfigUpdateFiles
#>
[CmdletBinding()]
Param()
Begin
{
if($wsus)
{
$_wsusconfig = $wsus.GetConfiguration()
$_wsusconfig.ServerId = [System.Guid]::NewGuid()
$_wsusconfig.Save()
}#endif
else
{
Write-Warning "Use Connect-PSWSUSServer to establish connection with your Windows Update Server"
Break
}
}
Process
{
Write-Verbose "Getting WSUS update source configuration"
$wsus.GetConfiguration() | select HostBinariesOnMicrosoftUpdate, DownloadExpressPackages, DownloadUpdateBinariesAsNeeded, GetContentFromMU
}
End{}
}