Open saqib-s opened 11 months ago
(Thanks for sharing your hardwork!)
for the script: procative-remediation-creation.ps1
testing on a new Windows 11 23H2 machine, I found that the following code the $winget variable is returning empty.
$Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe")
I've replaced the variable with just the command and this seems to work.
so this: if ($(&winget upgrade) -like "* $app_2upgrade *") {
if ($(&winget upgrade) -like "* $app_2upgrade *") {
instead of this if ($(&$winget upgrade) -like "* $app_2upgrade *") {
if ($(&$winget upgrade) -like "* $app_2upgrade *") {
no sure if this is something related to new winget release or and update?
My mistake - this is the behaviour under User but as SYSTEM the commands you are using are correct.
(Thanks for sharing your hardwork!)
for the script: procative-remediation-creation.ps1
testing on a new Windows 11 23H2 machine, I found that the following code the $winget variable is returning empty.
$Winget = Get-ChildItem -Path (Join-Path -Path (Join-Path -Path $env:ProgramFiles -ChildPath "WindowsApps") -ChildPath "Microsoft.DesktopAppInstaller*_x64*\winget.exe")
I've replaced the variable with just the command and this seems to work.
so this:
if ($(&winget upgrade) -like "* $app_2upgrade *") {
instead of this
if ($(&$winget upgrade) -like "* $app_2upgrade *") {
no sure if this is something related to new winget release or and update?