Showing results for PowerTip - Scripting Blog [archived]

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 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 11, 2019
0
0

PowerTip: Identify if you are running on PowerShell Core

Doctor Scripto
Doctor Scripto

Summary: Pulling up the properties of $PSVersionTable to identify your PowerShell edition Hey, Doctor Scripto! I want to write my modules and scripts to be more portable. How can I tell if I am executing on PowerShell Core? Just use the $PSVersionTable object and examine the PSEdition value. If it returns 'Core' you are running on Pow...

PowerTipSean KearneyPowerShell
Sep 4, 2019
0
1

PowerTip: Read a JSON configuration file as a PowerShell object

Doctor Scripto
Doctor Scripto

Summary: Using the ConvertFrom-Json Cmdlet in PowerShell to read a JSON formatted file Hey, Doctor Scripto! I've seen a lot of JSON files in use in Azure. I'm not very good with editing JSON properly. Is there an easy way to read this and at least edit it with PowerShell? Most definitely my good friend. For the file below called "sett...

PowerTipSean KearneyPowerShell
Aug 21, 2019
0
0

PowerTip: Identify if SQL Servers are configured to best practices

Doctor Scripto
Doctor Scripto

Summary: Using the features of the SQLServer PowerShell module to run assessments of your servers How can I easily check that my SQL Servers are all configured to meet best practices? You can use SQL Server Assessments – the latest addition to the SQLServer PowerShell module. Just Run a best practices assessment on your SQL Server as ...

PowerTipPowerShellSQL Server