Closed jgcracknell1 closed 2 years ago
Hi, I am also getting this error and not sure how to proceed. Thanks! -Sam
Hey @jgcracknell1 and @exel2000,
How are you downloading the script? You can either download the ZIP file from the releases page, or click the Raw
button on the PS1 file page.
It appears you've download the GitHub page for the script and are trying to run an HTML file as a PowerShell script.
details-target btn-link d-lg-none mt-1 color-fg-inherit">
This string referenced in the error message has nothing to do with the WSUS script, but is part of the GitHub page.
That's weird, I don't understand how that's possible when I am running a powershell script? Anyway, I downloaded it again using your links and I think I am closer now. Now I get the following error message:
.\Optimize-WsusServer.ps1 : The script 'Optimize-WsusServer.ps1' cannot be run because the following modules that are specified by the "#requires" statements of the script are missing: SqlServer. At line:1 char:1
+ CategoryInfo : ResourceUnavailable: (Optimize-WsusServer.ps1:String) [], ScriptRequiresException
+ FullyQualifiedErrorId : ScriptRequiresMissingModules
Ok, I think at least part of my issue here is that I'm trying this on PS 5.1 and PS 7. I guess I need version 6? It ran partially in PS 7 after I installed the sql module but I got all kinds of red text complaining about all kinds of things. I do start getting prompts asking me if I want to perform certain functions but most of them seem to fail. I am 100% it's me doing something wrong, but still struggling to get this working. Is there a reliable link where i can get PS 6? everything seems to want me to use version 7. Thanks for the help!
Hi
I am getting this as errors when running the script
PS C:\a> .\Optimize-WsusServer.ps1 -FirstRun At C:\a\Optimize-WsusServer.ps1:235 char:180