Forum Discussion
LL10890
Jan 06, 2022Copper Contributor
Powershell Declaring XML in ModuleBase
I am automating Windows Updates on remote servers. I am using the PSWindowsUpdate module to make the updates. My question is regarding this error: Install-WindowsUpdate : Missing SmtpServer; Use -PS...
- Jan 27, 2022
LL10890 Did this work for you?
LL10890
Jan 19, 2022Copper Contributor
Thanks for the information. The XML file with those settings was created in the module's folder.
The question regards how to declare the PSWUSettings.xml in the Powershell command line.
Here is the error message I received.
Install-WindowsUpdate : Missing SmtpServer; Use -PSWUSettings or declare PSWUSettings.xml in ModuleBase path.
Thanks
Jan 19, 2022
LL10890 Sorry, my bad 🙂 It should be in a hashtable format, command should be something like
Install-WindowsUpdate -ComputerName nysrv1 -MicrosoftUpdate -AcceptAll - IgnoreReboot -SendReport –PSWUSettings @{SmtpServer="smtp.woshub.com";From="Email address removed";To="Email address removed";Port=25} -Verbose
(http://woshub.com/pswindowsupdate-module/)