Hi i am trying to run the following command to run windows update automatically.
But there is no one at the computer so this is executed remotely through a remote execution system.
The issue is that nuget prompts for confirmation i have tried to use -Force parameter with Install-PackageProvider -Name -NuGet -MinimumVersion 2.8.5.201 -Force but still i get the prompt.
Also i tried adding -Confirm:$false but i still get the prompt asking to select Yes No Suspend or Help
Powershell.exe -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force; Set-PSRepository -Name PSGallery -InstallationPolicy Trusted; Install-PackageProvider -Name Nuget -MinimumVersion 2.8.5.201 -Force; Install-Module PowerShellGet -AllowClobber -Force;Install-Module PSWindowsUpdate -Force; Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot"
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\ncuser\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):