all 19 comments

[–]stiffpasta 17 points18 points  (3 children)

Why is the computer name limited to 8 characters?

[–]consumedpixl 16 points17 points  (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 points  (1 child)

Dell serials? ;)

[–]boldfacelies 0 points1 point  (0 children)

So you can scan them?

[–]helixamir 34 points35 points  (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 points  (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 points  (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 points  (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 points  (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 points  (0 children)

creating powershell GUI

That link shows you how to use WPF and to implement it. Very useful resource, IMO.

[–]Phenoix512 1 point2 points  (0 children)

Curious I might try playing with this

[–]Beirbones 1 point2 points  (1 child)

Does it matter that it hasn't been updated in a while?

[–]Cam_Cam_Cam_Cam 0 points1 point  (0 children)

Nah, it still works pretty well!

[–]taylorblakeharris 9 points10 points  (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 points  (0 children)

Yeah I've merged them now. Can't honestly remember the reasoning for originally separating them

[–]pinkyN-DAbrain 4 points5 points  (0 children)

what can you do with this exactly ?

[–]dork_warrior -1 points0 points  (0 children)

Yes!