Showing results for Sean Kearney - Scripting Blog [archived]

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

Maximizing the Power of Here-String in PowerShell for Configuration Data

Doctor Scripto
Doctor Scripto

Summary: Discovering some of the awesome and neat ways to leverage a Here-String in a Script or function Q: Hey, Doctor Scripto! I used to write scripts with supporting configuration files that never really changed. I was wondering if there was any way to put them INSIDE the script directly to make it self contained. —AB A: Hello AB, I ...

Sean KearneyPowerShellDoctor Scripto
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
Sep 4, 2019
2
0

Configuring Startup Settings in Microsoft Teams with Windows PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the ConvertFrom-JSON and ConvertTo-JSON Cmdlets to edit a configuration file Q: Hey, Doctor Scripto! I need to be able to change the Startup settings in Teams (like the Auto launch feature). I can change it in the Interface, but I need to be able to edit across multiple systems. Could you lend me a hand? —RL A: Hello RL, ...

Sean KearneyPowerShellDoctor Scripto