Hi. I think you could replace ``` $winget_exe = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" if ($winget_exe.count -gt 1){ $winget_exe = $winget_exe[-1].Path } ``` with a one-liner, if I understand your intent correctly. `$winget_exe = Resolve-Path "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe" | Select -Last 1 ` Cheers