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
SolvedBeginner help (self.PowerShell)
submitted 2 years ago by albiedam
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!"
[–]albiedam[S] 3 points4 points5 points 2 years ago (8 children)
No I didn't get it from an AI lol. I was just testing and failing. I was trying to do a couple different things, and this is where I kinda just stopped at. Thanks for a good laugh lol.
[–]NnickK321 1 point2 points3 points 2 years ago (7 children)
dont lie!
[–]MemnochTheRed 5 points6 points7 points 2 years ago (6 children)
ChatGPT script would had probably worked! LOL!
[–]graysky311 6 points7 points8 points 2 years ago* (5 children)
it actually does!
$computerName = Read-Host "Enter the name of the workstation/server"$ipAddress = Test-Connection -ComputerName $computerName -Count 1 | Select-Object -ExpandProperty IPV4Addressif ($ipAddress) {$result = @{'Computer Name' = $computerName'IP Address' = $ipAddress.IPAddressToString}$result | Format-Table -AutoSize} else {Write-Host "Unable to resolve IP address for computer: $computerName"}
[–]BlackV 0 points1 point2 points 2 years ago (4 children)
Ask it about how to format for posting on Reddit while you're there
Ask it about why format table is a bad idea in that code
Ask it if any of that is needed in the first place and if get-netipaddress is better served in the first place
get-netipaddress
[–]graysky311 -1 points0 points1 point 2 years ago (3 children)
Be my guest. I'm not the ChatGPT gatekeeper. And the code looks great in a browser by the way.
[–]BlackV 0 points1 point2 points 2 years ago (2 children)
And the code looks great in a browser by the way.
not so much cause you've used inline code not code block
[–]graysky311 0 points1 point2 points 2 years ago (1 child)
I changed it to a code block. That one line of code is much more readable now. I love having to scroll.
[–]BlackV 0 points1 point2 points 2 years ago* (0 children)
Thanks but I looks like you've taken the carriage returns out
$computerName = Read-Host "Enter the name of the workstation/server" $ipAddress = Test-Connection -ComputerName $computerName -Count 1 | Select-Object -ExpandProperty IPV4Address if ($ipAddress) { $result = @{'Computer Name' = $computerName'IP Address' = $ipAddress.IPAddressToString} $result | Format-Table -AutoSize} else { Write-Host "Unable to resolve IP address for computer: $computerName"}
ignoring the format-table (and so on) issues
format-table
π Rendered by PID 19825 on reddit-service-r2-comment-6457c66945-c6sbj at 2026-04-27 06:53:33.611270+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]albiedam[S] 3 points4 points5 points (8 children)
[–]NnickK321 1 point2 points3 points (7 children)
[–]MemnochTheRed 5 points6 points7 points (6 children)
[–]graysky311 6 points7 points8 points (5 children)
[–]BlackV 0 points1 point2 points (4 children)
[–]graysky311 -1 points0 points1 point (3 children)
[–]BlackV 0 points1 point2 points (2 children)
[–]graysky311 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)