Evan Newton Posted May 16, 2022 Posted May 16, 2022 (edited) 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, 2022 by Evan Newton
Administrators Paul Posted May 20, 2022 Administrators Posted May 20, 2022 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
Mark G38 Posted May 20, 2022 Posted May 20, 2022 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 Jamie Taylor 1
RobbieJ Posted February 22, 2023 Posted February 22, 2023 Â 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now