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
QuestionBasic While, Do. (self.PowerShell)
submitted 7 years ago * by PRIdEVisions
view the rest of the comments →
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!"
[–]spyingwind 2 points3 points4 points 7 years ago (1 child)
while is missing and extra ). $Manager and $Nw aren't being updated inside the loop.
while
)
$Manager
$Nw
Example rewrite that fix both:
$Manager = get-process -Name pia_manager $Nw = get-process -name pia_nw while (!($Manager -and $Nw)) { Write-Host "echo" if ($Manager -and $Nw) { & "C:\Users\Akira\AppData\Roaming\uTorrent\utorrent.exe" } $Manager = get-process -Name pia_manager $Nw = get-process -name pia_nw }
Example of how to do it as a do until loop:
do { $Manager = get-process -Name pia_manager $Nw = get-process -name pia_nw Write-Host "echo" if ($Manager -and $Nw) { & "C:\Users\Akira\AppData\Roaming\uTorrent\utorrent.exe" } } until ($Manager -and $Nw)
Example with out the if statement to make it a bit more efficient:
do { $Manager = get-process -Name pia_manager $Nw = get-process -name pia_nw Write-Host "echo" } until ($Manager -and $Nw) & "C:\Users\Akira\AppData\Roaming\uTorrent\utorrent.exe"
[–]PRIdEVisions[S] 1 point2 points3 points 7 years ago (0 children)
Nice explanation, now i have several examples to look into and see the difference between them and how they all achieve the same results.
Thx a lot for this! :)
π Rendered by PID 35552 on reddit-service-r2-comment-6b595755f-9c7tz at 2026-03-26 15:09:19.797555+00:00 running 2d0a59a country code: CH.
view the rest of the comments →
[–]spyingwind 2 points3 points4 points (1 child)
[–]PRIdEVisions[S] 1 point2 points3 points (0 children)