PS windows update problem
Hello, i created ps step and write it
Install-Module PSWindowsUpdate -Force
Get-WindowsUpdate -AcceptAll -Install -AutoReboot
but i have an error
Exception calling "ShouldContinue" with "2" argument(s): "Windows PowerShell is in NonInteractive mode. Read and Prompt
functionality is not available."
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:5908 char:8
+ if($Force -or $PSCmdlet.ShouldContinue($shouldContinueQueryMessag ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : PSInvalidOperationException
How can i do this?
Thank you.
Comments
I believe it is failing on the Install-Module command. I think you may need to install Nuget first. Here's how we handle modules in the PowerShell Scanners repo:
https://github.com/pdq/PowerShell-Scanners/blob/master/PowerShell%20Scanners/_Shared/Install%20and%20Import%20Module.ps1