Cezar
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Cezar
-
-
Deze script werkt als het gerunt is van een user account maar niet vanuit pulseway.
Â
$password = ConvertTo-SecureString "your_password" -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential("your_username", $password)$scriptBlock = {
  Start-Process powershell -Verb RunAs
  Write-Host "Running with elevated privileges!"
}$encodedCommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($scriptBlock))
Start-Process powershell.exe -ArgumentList "-NoProfile -EncodedCommand $encodedCommand" -Credential $credentials
Â
Microsoft Store application install from pulseway
in PowerShell
Posted
I made a script that installs lenovo vantage from microsoft store:
winget install "Lenovo Vantage" --source=msstore --accept-package-agreements --accept-source-agreements
When i want to run it from the pc i am working on it works just fine, but if i want to run it from pulseway i get this error:
Â
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 C:\Program Files (x86)\Pulseway\automation_55824cad_0bdb_4995_a6e0_9b420b5b32b1.ps1:1 char:1 + winget install "Lenovo Vantage" --source=msstore --accept-package-agr ... + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I already tried to run it from a workflow as a run shell command as current logged in user and still did not work.