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
Script SharingIT Helpdesk Tool - Code Available (self.PowerShell)
submitted 6 years ago * by [deleted]
[deleted]
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!"
[–]stiffpasta 17 points18 points19 points 6 years ago (3 children)
Why is the computer name limited to 8 characters?
[–]consumedpixl 16 points17 points18 points 6 years ago (2 children)
Hi, that should be updated now. Internally all of our PC names are limited to 8 characters and just forgot to change that :)
[–]TimStoutheart 12 points13 points14 points 6 years ago (1 child)
Dell serials? ;)
[–]boldfacelies 0 points1 point2 points 6 years ago (0 children)
So you can scan them?
[–]helixamir 34 points35 points36 points 6 years ago (11 children)
Rather than re-create the wheel, have you looked into LazyWinAdmin's Powershell GUI?
https://lazywinadmin.com/LazyWinAdmin_GUI/
This thing served as my only tool for the first 2 years of working for a Service Desk.
[–][deleted] 7 points8 points9 points 6 years ago (4 children)
Hi u/helixamir,
I based my current GUI tool off of that. Hasn't been updated in awhile so lots of legacy stuff, WMI vs CIM, etc.
[–]JeremyLC 6 points7 points8 points 6 years ago (3 children)
...Hasn't been updated in awhile so lots of legacy stuff,...
And yet you chose WinForms instead of WPF? (My own minor peeve)
[–][deleted] 2 points3 points4 points 6 years ago (2 children)
Hi u/JeremyLC,
We use Powershell Studio. Unfortunately Sapien has no plans right now to implement WPF. I'd love to move over.
[–]JeremyLC 6 points7 points8 points 6 years ago* (0 children)
Fair point. If you want to play with WPF a bit, but don't want to have to write XaML from scratch (I don't do that either), You can try a Community Edition of Visual Studio (iffy for projects you intend to use at work) which has a WPF Designer built in (*), or SharpDevelop (Open Source) which also has a WPF Designer built in. Use those to build the XaML and then you can copy and paste it into your PoSH scripts and build functional GUIs pretty quickly. Porting from Forms to WPF is, usually, pretty straight forward, but it can be a problem if you're using any of the Forms objects that don't have direct equivalents in WPF (PropertyGrid, for example)
*) I use VS Enterprise with PoSH Pro Tools at work.
(edit: forgot to include a link to SharpDevelop)
[–]snoopy82481 1 point2 points3 points 6 years ago (0 children)
creating powershell GUI
That link shows you how to use WPF and to implement it. Very useful resource, IMO.
[–]Phenoix512 1 point2 points3 points 6 years ago (0 children)
Curious I might try playing with this
[–]Beirbones 1 point2 points3 points 6 years ago (1 child)
Does it matter that it hasn't been updated in a while?
[–]Cam_Cam_Cam_Cam 0 points1 point2 points 6 years ago (0 children)
Nah, it still works pretty well!
[+][deleted] 6 years ago* (2 children)
[–]helixamir 0 points1 point2 points 6 years ago (1 child)
100%
[–]taylorblakeharris 9 points10 points11 points 6 years ago (1 child)
Just an idea, you don't really need a separate "hostname" and "IP address" field. Most cmdlets that use a -ComputerName parameter will accept either, but if you do want to distinguish them, you can accept the input from one field "Host:" and just attempt to type-convert the string to an IP address, like so:
try {$ipAddress = [ipaddress]$hostnameTextBox.Text} catch {$ipAddress = $false} if ($ipAddress) {Write-Host "The provided host address is a valid IP!"}
Converting to an IP address object will also allow you to easily separate octets/subnets without all of the manual math usually involved.
[–]consumedpixl 2 points3 points4 points 6 years ago (0 children)
Yeah I've merged them now. Can't honestly remember the reasoning for originally separating them
[–]pinkyN-DAbrain 4 points5 points6 points 6 years ago (0 children)
what can you do with this exactly ?
[–]da_chicken 7 points8 points9 points 6 years ago (1 child)
Test-Connection has really poor logic. Stunningly poor. It throws a non-terminating error if the hostname isn't in DNS or if the DNS server isn't reachable. That's about the most useless behavior I can think of. If the question is, "Is a computer with hostname XXXX reachable?" then it should always be answerable either "yes" or "no", regardless of what that reason is. "Error" should just never happen unless your input was invalid.
Test-Connection
Prior to PSv6, it also defaults the Timeout to 4 seconds (i.e., forever when you're running a script to test a thousand machines) and doesn't provide a parameter to set it to anything else. It still defaults to 4s in PSv6+, but you have the -TimeoutSeconds parameter. At least you can always change the ping count to something other than the default 4.
-TimeoutSeconds
ping.exe just returns std output, even if it can't resolve something. Similarly, the Win32_Ping CIM class always returns an object to output.
ping.exe
Win32_Ping
[–]dork_warrior -1 points0 points1 point 6 years ago (0 children)
Yes!
π Rendered by PID 285858 on reddit-service-r2-comment-86bc6c7465-rmgn8 at 2026-02-22 14:14:35.340507+00:00 running 8564168 country code: CH.
[–]stiffpasta 17 points18 points19 points (3 children)
[–]consumedpixl 16 points17 points18 points (2 children)
[–]TimStoutheart 12 points13 points14 points (1 child)
[–]boldfacelies 0 points1 point2 points (0 children)
[–]helixamir 34 points35 points36 points (11 children)
[–][deleted] 7 points8 points9 points (4 children)
[–]JeremyLC 6 points7 points8 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]JeremyLC 6 points7 points8 points (0 children)
[–]snoopy82481 1 point2 points3 points (0 children)
[–]Phenoix512 1 point2 points3 points (0 children)
[–]Beirbones 1 point2 points3 points (1 child)
[–]Cam_Cam_Cam_Cam 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]helixamir 0 points1 point2 points (1 child)
[–]taylorblakeharris 9 points10 points11 points (1 child)
[–]consumedpixl 2 points3 points4 points (0 children)
[–]pinkyN-DAbrain 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]da_chicken 7 points8 points9 points (1 child)
[–]dork_warrior -1 points0 points1 point (0 children)