Posted May 16, 20222 yr Hello, i am trying to setup a very simple script to install powertoys as we have a need for the image resize feature on some computers. it can be installed using the winget cmdlet in powershell or the windows terminal, i have run it manually on both widows 10 and 11, but running the script the pulseway give be the following  $ winget install Microsoft.PowerToys --source winget winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + winget install Microsoft.PowerToys --source winget + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Edited May 16, 20222 yr by Evan Newton
May 20, 20222 yr Administrators Hi Evan, winget is an msix (Windows Store Component, source) that must run in a per-user sandbox which is not available when running from the machine account (SYSTEM). You could force it to run against the logged in user (if any) through psexec but you'd need to distribute it somehow. -Paul
May 20, 20222 yr On 5/16/2022 at 2:29 PM, Evan Newton said: Hello, i am trying to setup a very simple script to install powertoys as we have a need for the image resize feature on some computers. it can be installed using the winget cmdlet in powershell or the windows terminal, i have run it manually on both widows 10 and 11, but running the script the pulseway give be the following  $ winget install Microsoft.PowerToys --source winget winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + winget install Microsoft.PowerToys --source winget + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException You can just use the RunAs PowerShell module as well to accomplish this if you don't feel like dealing with psexec and having to distribute the package yourself. This works fine for logged in users. It will check if you have the RunAs module installed and if not, install it first. $ErrorActionPreference = "SilentlyContinue"  if (!(Get-InstalledModule | Where-Object { $_.Name -eq "RunAsUser" })) {   Write-Host "Not Installed. Installing"   Install-Module RunAsUser -Force }  $ScriptBlock = {   winget install Microsoft.PowerToys --source winget }  Invoke-ASCurrentUser -ScriptBlock $ScriptBlock  Write-Host "Check Device to ensure PowerToys installed successfully."  Exit 0
February 22, 20232 yr  Hi, I found that the above solutions failed to work. In the end I talked to Pulseway support and they pointed out the following article where if you can enable and configure the "Enable PowerShell User Impersonation" found under the Pulseway Manager software Settings (tab) -> Runtime (tab). This is the article that describes it: https://intercom.help/pulseway/en/articles/1514837-how-to-configure-the-runtime-settings-for-the-pulseway-manager
Create an account or sign in to comment