[wpkg-users] Powershell and windows update...

Marco Gaiarin gaio at lilliput.linux.it
Thu Jul 13 15:35:48 CEST 2023


Mandi! Marco Gaiarin
  In chel di` si favelave...

> 'WU powershell addon/modules', via:
>         Install-PackageProvider -Name NuGet -Force
>         Install-Module -Name PSWindowsUpdate -Force
>         Set-ExecutionPolicy RemoteSigned -Force
>         Import-Module PSWindowsUpdate

OK, i can install the addon with:

<package
        id="win-ps-wu"
        name="Windows: install Windows Update PowerShell Module"
        revision="20230713:1"
        reboot="false"
        priority="5">

        <check type="execute" condition="exitcodeequalto" path='%COMSPEC% /c powershell -Command "Get-Package -Name PSWindowsUpdate | Select Name" | find "PSWindowsUpdate"' value="0"/>

        <install cmd='powershell -command "Install-PackageProvider -Name NuGet -Force | Out-Null"' />
        <install cmd='powershell -command "Install-Module -Name PSWindowsUpdate -Force | Out-Null"' />

        <upgrade include='install' />
        <downgrade include='upgrade' />

        <remove cmd='powershell -command "Uninstall-Package -Name PSWindowsUpdate -Force | Out-Null"' />
</package>


But i've not found a way to import the module permanently in powershell; eg,
if i run:

	<install cmd='powershell -ExecutionPolicy RemoteSigned -command "Import-Module -Name PSWindowsUpdate -Global | Out-Null"' />

'%COMSPEC% /c powershell -Command "Get-Module -Name PSWindowsUpdate | Select Name" | find "PSWindowsUpdate"'

return nothing, literallY, eg:

	'%COMSPEC% /c powershell -Command "Get-Module"'

still return nothing. 


What i'm missing?!

-- 
 Devi sapere che l'Universo può essere visto come una battaglia fra i
 sistemisti, che cercano di realizzare sistemi a prova d'idiota, e Dio
 che crea idioti sempre più sofisticati.
 Inutile dire che, per ora, Dio sta vincendo.	(Keisler, da i.n.n-a)




More information about the wpkg-users mailing list