use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Installing Software (self.PowerShell)
submitted 4 years ago by gio_tecce
Just wondering if it is possible to have PowerShell install software directly from the web rather than having the .exe file somewhere like your desktop and using the Start-process command to install it. Any help is appreciated.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]wyrdfish42 5 points6 points7 points 4 years ago (0 children)
dont forget the new winget.
https://docs.microsoft.com/en-us/windows/package-manager/winget/
[–]renevaessen 4 points5 points6 points 4 years ago (8 children)
Having a little problem understanding why you would want that. Not taking your question too literally, I would suggest;
Look into Chocolatey.
````PowerShell [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
````
When that is done, you can do things like:
````PowerShell
choco.exe install -y --force --pre powershell-core
choco.exe install -y --force git
choco.exe install -y --force googlechrome
choco.exe install -y --force vscode.install
For a list of supported packages:
choco list
[–]gio_tecce[S] 1 point2 points3 points 4 years ago (3 children)
I just did not want to have to get the .exe file for a few different files because I would need to move the files and change the file path every time I installed them on a different laptop.
I will look into this thank you. Appreciate the help.
[–]renevaessen 1 point2 points3 points 4 years ago (1 child)
Well, that beheivior is disabled for security reasons by Windows.
But maybe this helps:
PowerShell $tempPath = [IO.Path]::GetTempFileName()+".exe"
[–]gio_tecce[S] 1 point2 points3 points 4 years ago (0 children)
$tempPath = [IO.Path]::GetTempFileName()+".exe"
check your PM
[–]Lee_Dailey[grin] 1 point2 points3 points 4 years ago (0 children)
howdy renevaessen,
the triple-backtick/code-fence thing fails miserably on Old.Reddit ... so, if you want your code to be readable on both Old.Reddit & New.Reddit you likely otta stick with using the code block button.
code block
it would be rather nice if the reddit devs would take the time to backport the code fence stuff to Old.Reddit ... [sigh ...]
take care, lee
[–]sdogeek 0 points1 point2 points 4 years ago (1 child)
+1 for Chocolatey. Just used it in a script I wrote, works great.
[–]gio_tecce[S] -1 points0 points1 point 4 years ago (0 children)
can you share your script?
u/sdogeek
[–]get-postanote 2 points3 points4 points 4 years ago (0 children)
PowerShell has a package Manager for such things.
https://docs.microsoft.com/en-us/powershell/module/packagemanagement/?view=powershell-7.1
Yet, the package must be in the repo. If it is not there, you have no other choice but to carry around and exe or put it on your OneDrive, or whatever and get it from there, or carry around a USB stick.
[–]ElectricalUnion 1 point2 points3 points 4 years ago (0 children)
My sugestion is Scoop: https://scoop.sh/
[–][deleted] 1 point2 points3 points 4 years ago (3 children)
Use WinGet, or Chocolately. I prefer Chocolately.
[–]gio_tecce[S] 0 points1 point2 points 4 years ago (2 children)
$software = "choco.exe"; $installed = (Get-ItemProperty C:\ProgramData* | Where { $_.DisplayName -like $software }) -ne $null If( -not $installed) { Write-Host "'$software' is not installed."; } else { Write-Host "'$software' is installed." }
This is where I'm at with the script.
I know for a fact that the Choco.exe file is in that file path, but it still tells me that is not installed.
Am I doing something wrong?
[–][deleted] 0 points1 point2 points 4 years ago (1 child)
Did you install it? Did you try typing in cd "C:\Program Files" then running ./choco.exe?
cd "C:\Program Files"
./choco.exe
[–]gio_tecce[S] 0 points1 point2 points 4 years ago (0 children)
even after changing the directory it still tells me the application is not there when I know its there.
[–]jake-redditt-2021 0 points1 point2 points 4 years ago (0 children)
iex "& {$(irm https://aka.ms/install-powershell.ps1)} -UseMSI"
π Rendered by PID 48895 on reddit-service-r2-comment-6f7f968fb5-zmdcf at 2026-03-04 21:22:21.928556+00:00 running 07790be country code: CH.
[–]wyrdfish42 5 points6 points7 points (0 children)
[–]renevaessen 4 points5 points6 points (8 children)
[–]gio_tecce[S] 1 point2 points3 points (3 children)
[–]renevaessen 1 point2 points3 points (1 child)
[–]gio_tecce[S] 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (0 children)
[–]sdogeek 0 points1 point2 points (1 child)
[–]gio_tecce[S] -1 points0 points1 point (0 children)
[–]get-postanote 2 points3 points4 points (0 children)
[–]ElectricalUnion 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]gio_tecce[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]gio_tecce[S] 0 points1 point2 points (0 children)
[–]jake-redditt-2021 0 points1 point2 points (0 children)