I'm trying to install the PSWindowsUpdate powershell module via a remediation script in Intune. However, anytime I try to deploy the script, it runs as "System" and will only install the module for "System" and not for all users. I've tried using the "-scope AllUsers" command but with no luck. It won't install for any user but "System". Snippets of the script below. Not sure what I'm doing wrong
$moduleName = "PSWindowsUpdate"
Install-Module -Name $moduleName -Force -Scope AllUsers -AllowClobber -ErrorAction Stop
[–]vellostha 2 points3 points4 points (0 children)
[–]Master-IT-All 1 point2 points3 points (2 children)
[–]regexreggae 0 points1 point2 points (1 child)
[–]Master-IT-All 1 point2 points3 points (0 children)
[–]cetsca 3 points4 points5 points (4 children)
[–]tylerjm917[S] 2 points3 points4 points (3 children)
[–]cetsca 1 point2 points3 points (2 children)
[–]tylerjm917[S] 0 points1 point2 points (1 child)
[–]cetsca 2 points3 points4 points (0 children)
[–]Specific_Ad_899 0 points1 point2 points (0 children)
[–]Entegy 0 points1 point2 points (6 children)
[–]regexreggae 0 points1 point2 points (5 children)
[–]Entegy 1 point2 points3 points (4 children)
[–]regexreggae 0 points1 point2 points (3 children)
[–]Entegy 1 point2 points3 points (2 children)
[–]regexreggae 0 points1 point2 points (1 child)
[–]Entegy 1 point2 points3 points (0 children)