Search found 63 matches

by MarvelManiac
Wed Aug 01, 2018 8:49 am
Forum: PowerShell
Topic: Try Catch Finally
Replies: 13
Views: 3151

Re: Try Catch Finally

yeah, our systems that are connected on wireless and invoke-command don't play nice together
by MarvelManiac
Wed Aug 01, 2018 8:32 am
Forum: PowerShell
Topic: Try Catch Finally
Replies: 13
Views: 3151

Re: Try Catch Finally

Soooo if that's the case, why does it run?

as I mentioned, if I run it again 98% of the script goes through
the two items that should work, don't lol

the reason why I'm trying to use enter-pssession is because our wireless clients can't take some commands without timing out.
by MarvelManiac
Wed Aug 01, 2018 8:25 am
Forum: PowerShell
Topic: Try Catch Finally
Replies: 13
Views: 3151

Try Catch Finally

Hello, I'm in need of being able to stop some processes and stop and start some Scheduled tasks, so far here is my script. Does this look acceptable? $computer = 'PC123' try{ Enter-PSSession -Credential (Get-Credential -Credential $env:username) -ComputerName $computer -ErrorAction Stop } catch{ $_....
by MarvelManiac
Wed Aug 01, 2018 8:21 am
Forum: PowerShell GUIs
Topic: Get-Credential
Replies: 2
Views: 853

Re: Get-Credential

Hmm, even with not using -RunAsAdministrator its failing :(
It's okay... Thank you so much for your time!
by MarvelManiac
Mon Jul 30, 2018 6:42 pm
Forum: PowerShell GUIs
Topic: Get-Credential
Replies: 2
Views: 853

Get-Credential

Hello, Creating a gui to change power plans. This is done. But I noticed we use on one PC that we log in as a normal user because multiple techs use it ISE works just fine but when I attempt this in gui form, it does not retrieve the current power plan $sb = { (powercfg /l | ? { $_.Contains('*') -an...
by MarvelManiac
Mon Jun 04, 2018 3:19 pm
Forum: PowerShell GUIs
Topic: Textbox and RegEx
Replies: 4
Views: 1323

Re: Textbox and RegEx

This is a gui to install an application out of a few thousand

so tech gets a call to install software, they can copy and paste from the ticket, or type in the characters individually

Copy and paste seems to be working fine.
by MarvelManiac
Mon Jun 04, 2018 3:06 pm
Forum: PowerShell GUIs
Topic: Textbox and RegEx
Replies: 4
Views: 1323

Re: Textbox and RegEx

Not really spell check.. I just don't want them to be able to input anything but PC123 or SRV123. This is what I'm hoping my regex does, but that doesn't seem to be working as I expected.

The technicians will either type the PC name in 1 letter at a time or copy and paste the PC name
by MarvelManiac
Mon Jun 04, 2018 2:52 pm
Forum: PowerShell GUIs
Topic: Textbox and RegEx
Replies: 4
Views: 1323

Textbox and RegEx

We have servers and PCs in our environment trying to force the users to make sure it's typed in correct in a textbox for validation so example PC123 or SRV123 $textbox1_TextChanged={ if ($textbox1.Text.trim() -match '[Pp]{1}[Cc]{1}\d{3}$|[Ss]{1}[Rr]{1}[Vv]{1}\d{3}$') {script} } else{$wshell = New-Ob...
by MarvelManiac
Mon May 07, 2018 7:06 am
Forum: PowerShell GUIs
Topic: Why are PowerShell Studio GUI's not WYSIWYG?
Replies: 4
Views: 1841

Re: Why are PowerShell Studio GUI's not WYSIWYG?

I would throw in the fact when making an application, your DPI should be set at 100% and the form has the setting of AutoScaleMode to Dpi
I have 2k monitors and the techs have 1920x1080 monitors and all buttons,labels, text, etc.. are the same across all 100+ computers
by MarvelManiac
Tue Apr 10, 2018 9:47 pm
Forum: PowerShell
Topic: Using ADSI to get local admins
Replies: 1
Views: 1212

Using ADSI to get local admins

Hello, So I've seen this code posted several times around the web ([ADSI]("WinNT://PCNAME/Administrators,group")).Invoke('Members') | ForEach-Object { ($_.GetType()).InvokeMember('ADspath', 'GetProperty', $null, $_, $null).Replace('WinNT://', '') } Can anyone explain Why it takes so long somtimes? I...