Showing results for Doctor Scripto - Scripting Blog [archived]

Oct 2, 2019
2
0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 2

Doctor Scripto
Doctor Scripto

Summary: Using Measure-Command to determine the fastest approach to a solution. Last week we were having some fun using PowerShell as a wrapper around the NetSh.exe command's output. We were left at a decision point. Which way to go? A For loop to clean up the data, which worked fine or Regular Expressions. Although both work which was the be...

scripting techniquesSean KearneyPowerShell
Sep 25, 2019
2
0

PowerTip: Converting a Here-String to an Array in One Line with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the split method in a more powerful fashion to split an array based upon two line terminating types Hey, Doctor Scripto. I was wondering if there was a more efficient way of converting a Here-String to an Array when there were multiple line termination options like Linefeed or Carriage Return and Linefeed? There most de...

PowerTipPowerShellregular expressions
Sep 25, 2019
0
0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 1

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell and Regular Expressions as a wrapper on NetSh.exe output to identify the profiles. Hey, Doctor Scripto! I have a whole pile of old Wireless profiles that have been collecting dust. I know I can use NETSH to view and delete them, but the process is very manual. Do you know if there is an easier way to clear them up? ...

Sean KearneyPowerShellregular expressions
Sep 18, 2019
1
0

PowerTip: Identify which Platform PowerShell is running on

Doctor Scripto
Doctor Scripto

Summary: Using $PSVersionTable to identify if you are on Windows or Unix Hey, Doctor Scripto! I'm working on my PowerShell scripts and I need to be able to identify if I'm working on Windows or Linux. How can I do this easily? No problem at all and glad to help. Just examine the $PSVersionTable property called Platform. It will contai...

PowerTipSean KearneyPowerShell
Sep 18, 2019
1
0

Creating a Platform Independent Function in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Creating a Function in PowerShell and the power of the $PSVersionTable to make code more portable Q: Hey, Doctor Scripto! I saw that post last week on converting Here-String into an array. I wanted to write my code to trap for PowerShell and PowerShell Core. Could you give me a helping hand? —PG A: Hello PG, Hello everyone, ...

scripting techniquesSean KearneyPowerShell