&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Articles from February 2019 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2019/02/</link><description>Recent content in Articles from February 2019 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2019/02/index.xml" rel="self" type="application/rss+xml"/><item><title>ICYMI: PowerShell Week of 22-February-2019</title><link>https://powershell.org/articles/2019-02-22-icymi-powershell-week-of-22-february-2019/</link><guid>https://powershell.org/articles/2019-02-22-icymi-powershell-week-of-22-february-2019/</guid><pubDate>Fri, 22 Feb 2019 16:00:51 +0000</pubDate><description>&lt;p&gt;Topics include PoshBot, JeaDsc, Azure Pipelines, Arrays and Hashtables, and Pester testing.&lt;/p&gt;
&lt;p&gt;Content curated by Brett Bunker, Robin Dadswell, and Mark Roloff.&lt;/p&gt;
&lt;h3 id="writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets" class="ps-heading wp-block-heading"&gt;&lt;a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets"&gt;&lt;/a&gt;&lt;a href="https://andrewpla.github.io/Writing-a-PoshBot-Plugin/"&gt;&lt;em&gt;Writing a PoshBot Plugin to Display TOPdesk Tickets and Assets&lt;/em&gt;&lt;/a&gt;&lt;a class="ps-heading-anchor" href="#writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;by Andrew Pla on February 16th&lt;/p&gt;
&lt;p&gt;Creating bots for Teams or Slack can make you more productive and save time by not having to swtich between applications. Come let Andrew show you how to create a bot for Teams using PoshBot.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include PoshBot, JeaDsc, Azure Pipelines, Arrays and Hashtables, and Pester testing.</p><p>Content curated by Brett Bunker, Robin Dadswell, and Mark Roloff.</p><h3 id="writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets"/><a href="https://andrewpla.github.io/Writing-a-PoshBot-Plugin/"><em>Writing a PoshBot Plugin to Display TOPdesk Tickets and Assets</em></a><a class="ps-heading-anchor" href="#writing-a-poshbot-plugin-to-display-topdesk-tickets-and-assets" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Andrew Pla on February 16th</p><p>Creating bots for Teams or Slack can make you more productive and save time by not having to swtich between applications. Come let Andrew show you how to create a bot for Teams using PoshBot.</p><h3 id="heading" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#scriptblock-and-convertto-json-a-match-made-in-recursive-hell"/><a href="https://chrislgardner.github.io/powershell/2019/02/17/convertto-json-scripblock.html"><em>[Scriptblock] and ConvertTo-Json: a match made in recursive hell</em></a><a class="ps-heading-anchor" href="#heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Chris Gardner on February 17th</p><p>Interested in deploying JEA in your environment? JeaDsc can help you deploy JEA endpoints across your enterprise, but there may be a gothcha with JSON. Let Chris show you how he resolved this issue.</p><h3 id="how-i-failed-my-way-to-success-with-azure-pipelines---part-2-release" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#how-i-failed-my-way-to-success-with-azure-pipelines---part-2-release"/><a href="https://king.geek.nz/2019/02/17/how-i-failed-my-way-to-success-with-azure-pipelines-part-2-release/"><em>How I Failed My Way to Success with Azure Pipelines - Part 2: Release</em></a><a class="ps-heading-anchor" href="#how-i-failed-my-way-to-success-with-azure-pipelines---part-2-release" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Josh King on February 17th</p><p>Josh walks you through setting up and configuring an Azure pipeline to use with PowerShell in this blog post. Testing in production is optional.</p><h3 id="powershell--few-tricks-about-hashtables-and-arrays-i-wish-i-knew-when-i-started" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#powershell--few-tricks-about-hashtables-and-arrays-i-wish-i-knew-when-i-started"/><a href="https://evotec.xyz/powershell-few-tricks-about-hashtable-and-array-i-wish-i-knew-when-i-started/amp/?__twitter_impression=true"><em>PowerShell – Few tricks about HashTables and Arrays I wish I knew when I started</em></a><a class="ps-heading-anchor" href="#powershell--few-tricks-about-hashtables-and-arrays-i-wish-i-knew-when-i-started" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Przemyslaw Klys on February 19th</p><p>Dive into some great examples on how to make you HashTables and Arrays look better and perform faster. Follow along with this post filled with great examples to improve your code.</p><h3 id="pester-testing-self-contained-scripts" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#pester-testing-self-contained-scripts"/><a href="https://nocolumnname.blog/2019/02/20/pester-testing-self-contained-scripts/amp/?__twitter_impression=true"><em>Pester Testing Self Contained Scripts</em></a><a class="ps-heading-anchor" href="#pester-testing-self-contained-scripts" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Shane O&rsquo;Neill on February 20th</p><p>Pestering your code is a good thing. Shane shows how to get started testing with Pester, with a tip for a great video to watch for even more Pester goodness.</p><h3 id="reddit-rpowershell---most-popular-weekly-post" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#reddit-rpowershell---most-popular-weekly-post"/><a href="https://www.reddit.com/r/PowerShell/comments/asabxe/"><em>Reddit /r/PowerShell - Most Popular Weekly Post</em></a><a class="ps-heading-anchor" href="#reddit-rpowershell---most-popular-weekly-post" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Query Powershell Data Types?</p><h3 id="tweet-of-the-week" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#tweet-of-the-week"/><a href="https://twitter.com/alistek/status/1097961047825309702"><em>Tweet of the Week</em></a><a class="ps-heading-anchor" href="#tweet-of-the-week" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Powershell Core v6.1.3 was just released.</p><h3 id="youtube-an-introduction-to-just-enough-administration-with-james-petty" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190222.md#youtube-an-introduction-to-just-enough-administration-with-james-petty"/><a href="https://youtu.be/gyfYu-EbfEU"><em>Youtube: An Introduction to Just Enough Administration with James Petty</em></a><a class="ps-heading-anchor" href="#youtube-an-introduction-to-just-enough-administration-with-james-petty" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Research Triangle PowerShell Users Group Meetup</p>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 15-February-2019</title><link>https://powershell.org/articles/2019-02-15-icymi-powershell-week-of-15-february-2019/</link><guid>https://powershell.org/articles/2019-02-15-icymi-powershell-week-of-15-february-2019/</guid><pubDate>Fri, 15 Feb 2019 16:00:54 +0000</pubDate><description>&lt;p&gt;Topics include Iron Scripter, monitoring your filesystem, VSCode goodness, and more.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include Iron Scripter, monitoring your filesystem, VSCode goodness, and more.</p><p>Content curated by Brett Bunker, Robin Dadswell, and Mark Roloff.</p><h6 id="iron-scripter-2019-begins" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#iron-scripter-2019-begins"/><a href="https://powershell.org/2019/02/iron-scripter-2019-begins/"><em>IRON SCRIPTER 2019 BEGINS!</em></a><a class="ps-heading-anchor" href="#iron-scripter-2019-begins" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Don Jones on February 13th</p><p>In case you missed it, here it is. The Iron Scripter challenges have officially kicked off with the first warm-up challenge having been posted. Solve challenges, join a faction, and show off your scripting-chops!</p><h6 id="monitor-file-changes-in-windows-with-powershell-and-pswatch" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#monitor-file-changes-in-windows-with-powershell-and-pswatch"/><a href="https://4sysops.com/archives/monitor-file-changes-in-windows-with-powershell-and-pswatch/"><em>Monitor file changes in Windows with PowerShell and pswatch</em></a><a class="ps-heading-anchor" href="#monitor-file-changes-in-windows-with-powershell-and-pswatch" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Dan Franciscus on February 11th</p><p>Dan gives a quick look into how easy it is to catch filesystem changes in real time with the PSWatch module.</p><h6 id="group-email-notification-for-dataset-refresh-failure" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#group-email-notification-for-dataset-refresh-failure"/><a href="https://insightsquest.com/2019/02/13/group-email-notification-for-dataset-refresh-failure/"><em>Group Email Notification For Dataset Refresh Failure</em></a><a class="ps-heading-anchor" href="#group-email-notification-for-dataset-refresh-failure" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Brett Powell on February 13th</p><p>Here&rsquo;s a nice example of how PS can fit into a chain of other tools to create a novel solution. Brett enables an entire team to be notified in the event of dataset refresh failures.</p><h6 id="how-to-save-command-output-to-file-using-command-prompt-or-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#how-to-save-command-output-to-file-using-command-prompt-or-powershell"/><a href="https://www.windowscentral.com/how-save-command-output-file-using-command-prompt-or-powershell"><em>How to save command output to file using Command Prompt or PowerShell</em></a><a class="ps-heading-anchor" href="#how-to-save-command-output-to-file-using-command-prompt-or-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Mauro Huculak on February 12th</p><p>It&rsquo;s a simple but useful tip. Redirecting your output for later review or sharing can be handy for any number of scenarios.</p><h6 id="reddit-rpowershell---popular-weekly-post" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#reddit-rpowershell---popular-weekly-post"/><a href="https://www.reddit.com/r/PowerShell/comments/aoz36i/made_a_suite_of_powershell_gui_spelling_games_for/"><em>Reddit /r/PowerShell - Popular Weekly Post</em></a><a class="ps-heading-anchor" href="#reddit-rpowershell---popular-weekly-post" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>PowerShell for education! /u/Crimson_89 created a collection of GUI spelling games for their kids. Be sure to check out the repo in the comments.</p><h6 id="youtube-powershell-x2665xfe0f-vscode" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190215.md#youtube-powershell-%EF%B8%8F-vscode"/><a href="https://www.youtube.com/watch?v=tQLDRYIhmy0"><em>YouTube: PowerShell ♥️ VSCode</em></a><a class="ps-heading-anchor" href="#youtube-powershell-x2665xfe0f-vscode" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>Presenting to the Dutch PowerShell User Group, Tyler Leonhardt demonstrates many of the finer features of VSCode with the PS extension.</p>]]></content:encoded></item><item><title>Tips for Writing Cross-Platform PowerShell Code</title><link>https://powershell.org/articles/2019-02-14-tips-for-writing-cross-platform-powershell-code/</link><guid>https://powershell.org/articles/2019-02-14-tips-for-writing-cross-platform-powershell-code/</guid><pubDate>Thu, 14 Feb 2019 18:17:40 +0000</pubDate><description>&lt;p&gt;I just spent a month updating &lt;a href="https://www.powershellgallery.com/packages/Whiskey/"&gt;one of our PowerShell modules&lt;/a&gt; to support Linux and MacOS. I learned a lot that I wanted to share with the community as cross-platform support becomes more and more important.&lt;/p&gt;
&lt;h2 id="use-environment-class-properties-instead-of-env-drive" class="ps-heading wp-block-heading"&gt;Use &amp;ldquo;Environment&amp;rdquo; Class Properties Instead of &amp;ldquo;env:&amp;rdquo; Drive&lt;a class="ps-heading-anchor" href="#use-environment-class-properties-instead-of-env-drive" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Environment variables are different between the different operating systems. All of them have&lt;/p&gt;
&lt;p&gt;&lt;code&gt;PATH &lt;/code&gt;, but not much else. Windows and MacOS both have variables for the temp directory, but they have different names.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I just spent a month updating<a href="https://www.powershellgallery.com/packages/Whiskey/">one of our PowerShell modules</a> to support Linux and MacOS. I learned a lot that I wanted to share with the community as cross-platform support becomes more and more important.</p><h2 id="use-environment-class-properties-instead-of-env-drive" class="ps-heading wp-block-heading">Use &ldquo;Environment&rdquo; Class Properties Instead of &ldquo;env:&rdquo; Drive<a class="ps-heading-anchor" href="#use-environment-class-properties-instead-of-env-drive" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Environment variables are different between the different operating systems. All of them have</p><p><code>PATH</code>, but not much else. Windows and MacOS both have variables for the temp directory, but they have different names.</p><p>Instead of using environment variables like</p><p><code>$env:USERNAME</code>, use the</p><p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.environment">static properties on the Environment class instead</a>. They return the correct values across operating systems.</p><p>`Instead Of Use</p><hr><p>$env:USERNAME [Environment]::UserName
$env:COMPUTERNAME [Environment]::MachineName</p><p>n [Environment]::NewLine<code>r</code>n [Environment]::NewLine
$env:TEMP [IO.Path]::GetTempDirectory()</p><p>The</p><p><code>Environment</code>class also has neat properties like</p><p><code>Is64BitProcess</code>,</p><p><code>Is64BitOperatingSystem</code>, and</p><p><code>UserInteractive</code>, which aren&rsquo;t exposed in the</p><p><code>env:</code>drive.</p><h2 id="use-the-same-case-when-readingsetting-environment-variables" class="ps-heading wp-block-heading">Use the Same Case When Reading/Setting Environment Variables<a class="ps-heading-anchor" href="#use-the-same-case-when-readingsetting-environment-variables" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Environment variable names are case-sensitive on MacOS and Linux, regardless of how you access them. So,</p><p><code>$env:Path [Environment]::GetEnvironmentVariable('Path')</code>would return nothing on MacOS or Linux, because the path environment variable is</p><p><code>PATH</code>on those platforms. Since environment variable names are case-insensitive on Windows, you should prefer the case from Linux/MacOS.</p><h2 id="always-use-join-path-to-create-path-strings" class="ps-heading wp-block-heading">Always Use &ldquo;Join-Path&rdquo; to Create Path Strings<a class="ps-heading-anchor" href="#always-use-join-path-to-create-path-strings" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h3 id="when-the-path-originates-in-your-code" class="ps-heading wp-block-heading">When the Path Originates in Your Code<a class="ps-heading-anchor" href="#when-the-path-originates-in-your-code" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Never, ever put paths together with strings, e.g.</p><p><code>"BasePath\ChildPath"</code>. That path won&rsquo;t work on Linux or MacOS because their file systems see the</p><p><code>\</code>character as an escape character, not a directory separator. Instead, use</p><p><code>Join-Path</code>. Not only does it use the correct directory separator, but it converts directory separators to the directory separator for the current platform.</p><p>For example,</p><p><code>Join-Path -Path '\usr\bin' -ChildPath 'dotnet'</code>returns</p><p><code>/usr/bin/dotnet</code>on Linux/MacOS and</p><p><code>\usr\bin\dotnet</code>on Windows.</p><h3 id="when-the-path-comes-from-the-user" class="ps-heading wp-block-heading">When the Path Comes from the User<a class="ps-heading-anchor" href="#when-the-path-comes-from-the-user" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>In one situation, our module took in a path from the user via a configuration file. Normally, we would use</p><p><code>Resolve-Path</code>to get the full path to the file, which normalizes the directory separator, but in this situation, the path may be to a file the user wants us to create and</p><p><code>Resolve-Path</code>requires that the path exists. Here&rsquo;s how we got our paths normalized:</p><p>`# If the user didn&rsquo;t give us an absolute path,</p><h1 id="resolve-it-from-the-current-directory" class="ps-heading">resolve it from the current directory.<a class="ps-heading-anchor" href="#resolve-it-from-the-current-directory" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>if( -not [IO.Path]::IsPathRooted($archivePath) )
{
$archivePath = Join-Path -Path (Get-Location).Path -ChildPath $archivePath
}
$archivePath = Join-Path -Path $archivePath -ChildPath &lsquo;.&rsquo;
$archivePath = [IO.Path]::GetFullPath($archivePath)
`This trick relies on:</p><ul><li/></ul><p><code>Join-Path</code>normalizing our directory separators (line 7) and</p><ul><li>The<code>GetFullPath</code>method on the</li></ul><p><code>IO.Path</code>object replacing</p><p><code>..</code>and</p><p><code>.</code>characters to the parent/current item name, respectively (line 8).</p><p>This way we don&rsquo;t have to use regular expressions. We let .NET Core/PowerShell do that work for us.</p><h2 id="use-iopathdirectoryseparatorchar-when-you-cant-use-join-path" class="ps-heading wp-block-heading">Use &ldquo;[IO.Path]::DirectorySeparatorChar&rdquo; When You Can&rsquo;t Use &ldquo;Join-Path&rdquo;<a class="ps-heading-anchor" href="#use-iopathdirectoryseparatorchar-when-you-cant-use-join-path" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>If for some reason you can&rsquo;t use</p><p><code>Join-Path</code>to create a path or our strategy above, instead of hard-coding the directory separator character, use the</p><p><code>[IO.Path]::DirectorySeparatorChar</code>property to get the correct separator for the current operating system. For example,</p><p><code>'ParentPath{0}ChildPath' -f [IO.Path]::DirectorySeparatorChar</code>## Don&rsquo;t Use the &ldquo;-Qualifier&rdquo; Switch on &ldquo;Split-Path&rdquo; {.wp-block-heading}</p><p>In some of our tests, we want to create a path on the current drive:</p><p><code>$drive = Split-Path -Qualifier -Path $PSScriptRoot $path = Join-Path -Path $drive -ChildPath 'SomePath'</code>This doesn&rsquo;t work on Linux/MacOS because &ldquo;Qualifier&rdquo; is synonomous with &ldquo;Drive&rdquo; and only Windows has the concept of a drive. Instead, use the</p><p><code>PSDrive</code>property on the</p><p><code>FileInfo</code>object for the current file (or whatever file whose root path you want) to get the root path:</p><p><code>$root = (Get-Item -Path $PSScriptRoot).PSDrive.Root $path = Join-Path -Path $root -ChildPath 'SomePath'</code>The above code returns</p><p><code>/SomePath</code>on Linux/MacOS and</p><p><code>C:\SomePath</code>on Windows (assuming the current script is on the C: drive).</p><h2 id="use-the-same-case-for-hashtable-keys" class="ps-heading wp-block-heading">Use the Same Case for Hashtable Keys<a class="ps-heading-anchor" href="#use-the-same-case-for-hashtable-keys" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>On Linux, hashtable keys are case-sensitive. On Windows and MacOS, they aren&rsquo;t. So,</p><p><code>$ht = @{ 'Key' = 'Value' } $ht['KEY']</code>returns</p><p><code>Value</code>on Windows and MacOS, and</p><p><code>$null</code>on Linux.</p><h2 id="dont-use-aliases" class="ps-heading wp-block-heading">Don&rsquo;t Use Aliases<a class="ps-heading-anchor" href="#dont-use-aliases" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Don&rsquo;t use PowerShell&rsquo;s aliases in your scripts. They are different between operating systems. Many of the aliases on Windows were originally added to help non-Windows users find familiar commands, e.g.</p><p><code>ls</code>mapping to</p><p><code>Get-ChildItem</code>. We had one test fixture that was using</p><p><code>sc</code>instead of</p><p><code>Set-Content</code>. Those tests failed when run under Linux.</p><h2 id="use-iopathpathseparator-for-path-environment-variable" class="ps-heading wp-block-heading">Use &ldquo;[IO.Path]::PathSeparator&rdquo; for &ldquo;PATH&rdquo; Environment Variable<a class="ps-heading-anchor" href="#use-iopathpathseparator-for-path-environment-variable" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Windows uses a different path separator than Linux/MacOS for paths in the</p><p><code>PATH</code>environment variable. Windows uses</p><p><code>;</code>. Linux/MacOS use</p><p><code>:</code>. Instead of hard-coding those characters, use the</p><p><code>[IO.Path]::PathSeparator</code>property to use the correct separator for the current operating system. For example, this code shows how to split/join the</p><p><code>PATH</code>environment variable in a cross-platform way:</p><p>`# Get each path in the PATH environment variable.
$env:PATH -split [IO.Path]::PathSeparator</p><h1 id="add-a-path-to-the-current-sessions-path-environment-variable" class="ps-heading">Add a path to the current session&rsquo;s PATH environment variable<a class="ps-heading-anchor" href="#add-a-path-to-the-current-sessions-path-environment-variable" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>$env:PATH = &lsquo;{0}{1}{2}&rsquo; -f $env:PATH,[IO.Path]::PathSeparator,$NewPath
`## Warning: Windows Executables Run Under the Windows Subsystem for Linux {.wp-block-heading}</p><p>The Windows Subsytem for Linux is great. We used it a lot to get our module working under Linux instead of spinning up an entire VM. Even though it&rsquo;s running Linux, it&rsquo;s still on Windows, so Windows executables can still run. This is awesome but be mindful of the trade-off: if you have tests or code that run Windows executables, they&rsquo;ll appear to run fine under WSL, but fail when actually run on a Linux machine.</p><h2 id="omit-the-extension-when-searching-for-or-running-executables" class="ps-heading wp-block-heading">Omit the Extension When Searching for or Running Executables<a class="ps-heading-anchor" href="#omit-the-extension-when-searching-for-or-running-executables" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>On Windows, executable files have the</p><p><code>.exe</code>extension. On Linux/MacOS, an executable has file system permissions that mark a file as executable. If you&rsquo;re searching for or running a command that could exist on all operating systems, omit the extension from the name. On Windows, PowerShell will implicitly add the</p><p><code>.exe</code>extension for you (it actually uses the extensions in the</p><p><code>PATHEXT</code>environment variable to look for commands). For example, this code will return the path to the .NET Core and Node.js executables, if they exist in your</p><p><code>PATH</code>:</p><p>`# Finding commands
Get-Command -Name &lsquo;dotnet&rsquo; -ErrorAction Ignore
Get-Command -Name &rsquo;node&rsquo; -ErrorAction Ignore</p><h1 id="running-commands" class="ps-heading">Running commands<a class="ps-heading-anchor" href="#running-commands" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>dotnet &ndash;version
node &ndash;version
`If your commands exists outside a directory in your</p><p><code>PATH</code>environment variable, consider adding that directory to your</p><p><code>PATH</code>either permanently or temporarily so you don&rsquo;t have to build the logic of cross-platform executable naming yourself.</p><h2 id="supporting-windows-powershell-and-powershell-core" class="ps-heading wp-block-heading">Supporting Windows PowerShell and PowerShell Core<a class="ps-heading-anchor" href="#supporting-windows-powershell-and-powershell-core" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Some changes we encountered between operating systems weren&rsquo;t because of the operating systems but because we use PowerShell 5.1 on Windows. PowerShell 6 behaves differently from PowerShell 5.1 in some ways.</p><h3 id="use-the-fullname-property-on-fileinfo-and-directoryinfo-objects" class="ps-heading wp-block-heading">Use the &ldquo;FullName&rdquo; Property on &ldquo;FileInfo&rdquo; and &ldquo;DirectoryInfo&rdquo; Objects<a class="ps-heading-anchor" href="#use-the-fullname-property-on-fileinfo-and-directoryinfo-objects" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>In some situations converting</p><p><code>FileInfo</code>and</p><p><code>DirectoryInfo</code>objects to strings (i.e. the objects returned by using</p><p><code>Get-ChildItem</code>against the file system) behave differently. On Windows PowerShell, you&rsquo;ll get just the file&rsquo;s name. On PowerShell Core, you&rsquo;ll get the item&rsquo;s full name.</p><p>For example, this snippet returns each item&rsquo;s name on Windows PowerShell and each item&rsquo;s full name on PowerShell Core:</p><p><code>Get-ChildItem | ForEach-Object { [string]$_ }</code>Instead, use the</p><p><code>FullName</code>property to get the full path or</p><p><code>Name</code>to get just the name:</p><p>`# Returns each item&rsquo;s full path
Get-ChildItem | ForEach-Object { $_.FullName }</p><h1 id="returns-each-items-name" class="ps-heading">Returns each item&rsquo;s name<a class="ps-heading-anchor" href="#returns-each-items-name" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Get-ChildItem | ForEach-Object { $_.Name }
`### Use an Empty Error Type and Capability Checking When Handling &ldquo;Invoke-WebRequest&rdquo; Failures {.wp-block-heading}</p><p>The exception thrown by</p><p><code>Invoke-WebRequest</code>is different between Windows PowerShell and PowerShell Core. On Windows PowerShell, it is a</p><p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.webexception">System.Net.WebException</a>. On PowerShell Core, it is a<a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.powershell.commands.httpresponseexception?view=pscore-6.0.0">Microsoft.PowerShell.Commands.HttpResponseException</a>.</p><p>So, if you were handling failed web requests like this:</p><p><code>$uri = 'https://httpstat.us/500' try { Invoke-WebRequest -Uri $uri } catch [Net.WebException] { Write-Error -Message ('Failed requesting "{0}": {1}' -f $uri,$_.ErrorDetails) }</code>You should instead do:</p><p><code>$uri = 'https://httpstat.us/500' try { Invoke-WebRequest -Uri $uri } catch { $errorDetails = $null $response = $_.Exception | Select-Object -ExpandProperty 'Response' -ErrorAction Ignore if( $response ) { $errorDetails = $_.ErrorDetails } # Not an exception making the request or the failed request didn't have a response body. if( $errorDetails -eq $null ) { Write-Error -ErrorRecord $_ } else { Write-Error -Message ('Request to "{0}" failed: {1}' -f $uri,$errorDetails) } }</code>Notice that instead of checking what version of PowerShell we&rsquo;re on to know if the</p><p><code>ErrorDetails</code>contains the error&rsquo;s response body, we instead check for the existence of the</p><p><code>Response</code>property on the thrown exception. This property exists on the exception objects thrown by Windows PowerShell and PowerShell Core. This is called a capability check and is the preferred pattern for supporting different ways of doing things across versions and operating systems. When you check for functionality instead of versions, your code will work in more places.</p><h3 id="use-iswindows-islinux-and-ismacos-variables-sparingly" class="ps-heading wp-block-heading">Use &ldquo;IsWindows&rdquo;, &ldquo;IsLinux&rdquo;, and &ldquo;IsMacOS&rdquo; Variables<em>Sparingly</em><a class="ps-heading-anchor" href="#use-iswindows-islinux-and-ismacos-variables-sparingly" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>PowerShell 6 introduces three global variables that you can use to check which platform you&rsquo;re on. You should use these sparingly, and instead use capability checks (see above). If you absolutely need to know what operating system you&rsquo;re on, the</p><p><code>IsWindows</code>,</p><p><code>IsLinux</code>, and</p><p><code>IsMacOS</code>variables work great.</p><p>We turn on strict mode in all our scripts (i.e.</p><p><code>Set-StrictMode -Version 'Latest'</code>), so we can&rsquo;t just use these variables without getting errors on Windows PowerShell. Since they were introduced in PowerShell 6, and that version of PowerShell is the first to run on Linux and MacOS, if any of the variables don&rsquo;t exist, you know you&rsquo;re on Windows. If you have code/modules that need to run on Windows PowerShell</p><p><em>and</em> PowerShell Core, you can use this snippet to conditionally create these variables:</p><p><code>if( -not (Test-Variable 'variable:IsWindows') ) { # We know we're on Windows PowerShell 5.1 or earlier $IsWindows = $true $IsLinux = $IsMacOS = $false }</code>Be a good script/module neighbor by<em>not</em> making these global and instead restricting them to your script/module scope.</p><p>Thanks to<a href="https://github.com/DecoyJoe">Joseph Larionov</a>, who helped edit this article.</p>
]]></content:encoded></item><item><title>IRON SCRIPTER 2019 BEGINS!</title><link>https://powershell.org/articles/2019-02-13-iron-scripter-2019-begins/</link><guid>https://powershell.org/articles/2019-02-13-iron-scripter-2019-begins/</guid><pubDate>Wed, 13 Feb 2019 22:32:50 +0000</pubDate><description>&lt;p&gt;Go to &lt;a href="https://ironscripter.us/iron-scripter-2019-is-coming/"&gt;https://ironscripter.us/iron-scripter-2019-is-coming/&lt;/a&gt; right away!&lt;/p&gt;
&lt;p&gt;Even if you&amp;rsquo;re not attending Summit, these challenges are a great thing to jump into. They&amp;rsquo;re a fun chance to flex your PowerShell sk1llz, and the official Iron Scripter competition permits remote assistance to each of our three factions - so you can get in on the action from afar!&lt;/p&gt;
&lt;p&gt;We suggest using tags #battlefaction, #daybreakfaction, and #flawlessfaction, and #ironscripter2019 to hook up with fellow coders on social media. Visit the main &lt;a href="http://ironscripter.us"&gt;Iron Scripter&lt;/a&gt; website to learn more.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Go to<a href="https://ironscripter.us/iron-scripter-2019-is-coming/">https://ironscripter.us/iron-scripter-2019-is-coming/</a> right away!</p><p>Even if you&rsquo;re not attending Summit, these challenges are a great thing to jump into. They&rsquo;re a fun chance to flex your PowerShell sk1llz, and the official Iron Scripter competition permits remote assistance to each of our three factions - so you can get in on the action from afar!</p><p>We suggest using tags #battlefaction, #daybreakfaction, and #flawlessfaction, and #ironscripter2019 to hook up with fellow coders on social media. Visit the main<a href="http://ironscripter.us">Iron Scripter</a> website to learn more.</p><p>Not even sure how to join a faction? It&rsquo;s easy: read up on &rsquo;em and decide which one fits you. Then get in touch with your like-minded scripters. Arrange to communicate via Slack, Teams, GitHub, carrier pigeon, or whatever - Iron Scripter is all about mystery and ad-hoc, not about formal structures or rules.</p>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 8-February-2019</title><link>https://powershell.org/articles/2019-02-08-icymi-powershell-week-of-8-february-2019/</link><guid>https://powershell.org/articles/2019-02-08-icymi-powershell-week-of-8-february-2019/</guid><pubDate>Fri, 08 Feb 2019 16:00:03 +0000</pubDate><description>&lt;p&gt;Topics include adrenaline for your AKS deployments, Azure Pipelines, Universal Dashboard, and more.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include adrenaline for your AKS deployments, Azure Pipelines, Universal Dashboard, and more.</p><p>Content scoured by Brett Bunker, Robin Dadswell, and Mark Roloff.</p><h6 id="deploying-a-production-ready-azure-kubernetes-aks-cluster-with-psaksdeployment" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#deploying-a-production-ready-azure-kubernetes-aks-cluster-with-psaksdeployment"/><a href="https://mathieubuisson.github.io/deploying-aks-cluster-psaksdeployment/"><em>Deploying a production-ready Azure Kubernetes (AKS) cluster with PSAksDeployment</em></a><a class="ps-heading-anchor" href="#deploying-a-production-ready-azure-kubernetes-aks-cluster-with-psaksdeployment" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Mathieu Buisson on February 4th</p><p>Deploying AKS the officially documented way? Give this a read. Mathieu gives a great look into using this souped-up module to do some heavy lifting for you.</p><h6 id="powershell-function-to-connect-to-all-office-365-services-with-support-for-mfa" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#powershell-function-to-connect-to-all-office-365-services-with-support-for-mfa"/><a href="https://www.thelazyadministrator.com/2019/02/05/powershell-function-to-connect-to-all-office-365-services-with-support-for-mfa/"><em>PowerShell Function to Connect to All Office 365 Services With Support For MFA</em></a><a class="ps-heading-anchor" href="#powershell-function-to-connect-to-all-office-365-services-with-support-for-mfa" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Brad Wyatt on February 5th</p><p>Say goodbye to your ugly &ldquo;Log-into-too-many-PowerShell-cloud-services&rdquo; script and say hello to Brad&rsquo;s one-stop function. I can already think of a few places to start using this.</p><h6 id="the-top-6-powershell-commands-you-need-to-know-to-manage-office-365" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#the-top-6-powershell-commands-you-need-to-know-to-manage-office-365"/><a href="https://practical365.com/microsoft-365/the-top-6-powershell-commands-you-need-to-know-to-manage-office-365/"><em>The top 6 PowerShell commands you need to know to manage Office 365</em></a><a class="ps-heading-anchor" href="#the-top-6-powershell-commands-you-need-to-know-to-manage-office-365" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Steve Goodman on February 5th</p><p>If you&rsquo;re managing O365 and are new to PowerShell, this is a great little intro to the language from that perspective.</p><h6 id="retry-commands-in-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#retry-commands-in-powershell"/><a href="https://ridicurious.com/2019/02/01/retry-command-in-powershell/"><em>Retry Commands in PowerShell</em></a><a class="ps-heading-anchor" href="#retry-commands-in-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Prateek Singh on February 1st</p><p>Prateek has thrown together a very nice function that&rsquo;s tailor-made to handle all of your retry logic. Give it a whirl in your next script!</p><h6 id="how-i-failed-my-way-to-success-with-azure-pipelines---part-1-build" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#how-i-failed-my-way-to-success-with-azure-pipelines---part-1-build"/><a href="https://king.geek.nz/2019/02/07/how-i-failed-my-way-to-success-with-azure-pipelines/"><em>How I Failed My Way to Success with Azure Pipelines - Part 1: Build</em></a><a class="ps-heading-anchor" href="#how-i-failed-my-way-to-success-with-azure-pipelines---part-1-build" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Josh King on February 7th</p><p>If you&rsquo;ve got a public PowerShell project, consider hooking it up with in a release pipeline. Josh&rsquo;s first experiences with that will be a helpful guide in figuring that out.</p><h6 id="tweet-of-the-week" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#tweet-of-the-week"/><a href="https://twitter.com/BrettMiller_IT/status/1092062887957446657"><em>Tweet of the Week</em></a><a class="ps-heading-anchor" href="#tweet-of-the-week" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>I love RDCMan, so I was pretty stoked to find out that there&rsquo;s a module for generating its config files. Thanks, Brett!</p><h6 id="azposh-powershell-universal-dashboard" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190208.md#azposh-powershell-universal-dashboard"/><a href="https://www.youtube.com/watch?v=fl1RfXmjvPA"><em>AZPosh: PowerShell Universal Dashboard</em></a><a class="ps-heading-anchor" href="#azposh-powershell-universal-dashboard" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>Curious about Universal Dashboard? Adam Driscoll gives a tour of this awesome tool to the Arizona PSUG.</p>]]></content:encoded></item><item><title>Summit Expansion – Seeking Feedback</title><link>https://powershell.org/articles/2019-02-07-summit-expansion-seeking-feedback/</link><guid>https://powershell.org/articles/2019-02-07-summit-expansion-seeking-feedback/</guid><pubDate>Thu, 07 Feb 2019 16:00:21 +0000</pubDate><description>&lt;p&gt;Tickets for the 2019 PowerShell + DevOps Summit sold out faster this year than its predecessors by almost exactly a full month. We are all so very excited to see everyone this year at the Meydenbauer in Bellevue, Washington! But as we continue to outpace each year, we also understand that this means that the demand for the content we deliver at Summit is also growing .&lt;/p&gt;
&lt;p&gt;One of the early goals of the Summit was to keep the event relatively small to provide a more intimate feel. In doing so, it allows attendees a chance to see familiar faces as they come back every year, and have a chance to interact with the speakers, staff, and members of the PowerShell team. As the event has grown, we&amp;rsquo;ve been very careful to not lose that feel. So the question then is, what do we do in order to meet the demands of the community, and maintain that small event feel?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Tickets for the 2019 PowerShell + DevOps Summit sold out faster this year than its predecessors by almost exactly a full month. We are all so very excited to see everyone this year at the Meydenbauer in Bellevue, Washington! But as we continue to outpace each year, we also understand that this means that the demand for the content we deliver at Summit is also growing .</p><p>One of the early goals of the Summit was to keep the event relatively small to provide a more intimate feel. In doing so, it allows attendees a chance to see familiar faces as they come back every year, and have a chance to interact with the speakers, staff, and members of the PowerShell team. As the event has grown, we&rsquo;ve been very careful to not lose that feel. So the question then is, what do we do in order to meet the demands of the community, and maintain that small event feel?</p><p>James Petty (our CFO), Jeffrey Bernt (our logistics manager), and I have been having this very discussion over the last couple of months. We&rsquo;ve been doing a lot of homework on the resources it would require to organize and hold a second event. What would the goals of the event be? When do we have it? And so on, and so forth.</p><p>That&rsquo;s where you come in!</p><p>We&rsquo;re looking for some community feedback in helping us shape this second event. We&rsquo;ve put together a short survey (link below) to help us make some decisions on key questions as we look toward moving forward on this project. Ultimately, our goal is to provide the community with the best educational content possible, and there&rsquo;s no better way to do that than to keep you involved in the decisions that affect that content. We&rsquo;ll keep the survey open for a couple of weeks, and share the responses with you after the close.</p><p>From the team here at The DevOps Collective, we&rsquo;re all looking forward to growing with you in the coming future!</p><p><a href="https://survey.sogosurvey.com/r/4ZIAzl">https://survey.sogosurvey.com/r/4ZIAzl</a></p>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 1-February-2019</title><link>https://powershell.org/articles/2019-02-01-icymi-powershell-week-of-1-february-2019/</link><guid>https://powershell.org/articles/2019-02-01-icymi-powershell-week-of-1-february-2019/</guid><pubDate>Fri, 01 Feb 2019 16:00:40 +0000</pubDate><description>&lt;p&gt;Topics include Active Directory FSMO Roles, text parsing, error handling, and much more.&lt;/p&gt;
&lt;p&gt;Content pulled together by Robin Dadswell, Mark Roloff , and Brett Bunker.&lt;/p&gt;
&lt;h3 id="finding-active-directory-fsmo-role-holders-with-powershell" class="ps-heading wp-block-heading"&gt;&lt;a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#finding-active-directory-fsmo-role-holders-with-powershell"&gt;&lt;/a&gt;&lt;a href="https://mcpmag.com/articles/2019/01/25/finding-ad-fsmo-role-holders.aspx?m=1"&gt;&lt;em&gt;Finding Active Directory FSMO Role Holders with PowerShell&lt;/em&gt;&lt;/a&gt;&lt;a class="ps-heading-anchor" href="#finding-active-directory-fsmo-role-holders-with-powershell" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;by Adam Bertram January 25&lt;/p&gt;
&lt;p&gt;Need to find which DCs hold your FSMO roles? Adam demonstrates a quick way to find their location using PowerShell.&lt;/p&gt;
&lt;h3 id="parsing-text-with-powershell-33" class="ps-heading wp-block-heading"&gt;&lt;a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#parsing-text-with-powershell-33"&gt;&lt;/a&gt;&lt;a href="https://blogs.msdn.microsoft.com/powershell/2019/01/28/parsing-text-with-powershell-3-3/"&gt;&lt;em&gt;Parsing Text with PowerShell (3/3)&lt;/em&gt;&lt;/a&gt;&lt;a class="ps-heading-anchor" href="#parsing-text-with-powershell-33" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;by Steve Lee [MSFT] January 28&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include Active Directory FSMO Roles, text parsing, error handling, and much more.</p><p>Content pulled together by Robin Dadswell, Mark Roloff , and Brett Bunker.</p><h3 id="finding-active-directory-fsmo-role-holders-with-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#finding-active-directory-fsmo-role-holders-with-powershell"/><a href="https://mcpmag.com/articles/2019/01/25/finding-ad-fsmo-role-holders.aspx?m=1"><em>Finding Active Directory FSMO Role Holders with PowerShell</em></a><a class="ps-heading-anchor" href="#finding-active-directory-fsmo-role-holders-with-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Adam Bertram January 25</p><p>Need to find which DCs hold your FSMO roles? Adam demonstrates a quick way to find their location using PowerShell.</p><h3 id="parsing-text-with-powershell-33" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#parsing-text-with-powershell-33"/><a href="https://blogs.msdn.microsoft.com/powershell/2019/01/28/parsing-text-with-powershell-3-3/"><em>Parsing Text with PowerShell (3/3)</em></a><a class="ps-heading-anchor" href="#parsing-text-with-powershell-33" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Steve Lee [MSFT] January 28</p><p>Part 3 in the series on parsing text with PowerShell. A nice wrap up to the series with some example uses.</p><h3 id="how-to-create-multi-dimensional-arrays-in-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#how-to-create-multi-dimensional-arrays-in-powershell"/><a href="https://redmondmag.com/articles/2019/01/28/multi-dimensional-powershell-arrays.aspx?m=1"><em>How To Create Multi-Dimensional Arrays in PowerShell</em></a><a class="ps-heading-anchor" href="#how-to-create-multi-dimensional-arrays-in-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Brien Posey January 28</p><p>Do you need to go beyond basic arrays? Brien shows you how to create and use multi-demonsional arrays</p><h3 id="powershell-dont-just-throw" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#powershell-dont-just-throw"/><a href="https://jamesone111.wordpress.com/2019/01/30/powershell-dont-just-throw/"><em>PowerShell. Don’t Just Throw</em></a><a class="ps-heading-anchor" href="#powershell-dont-just-throw" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by James O&rsquo;Neill January 30</p><p>Why put a Return after a Throw? James gives some examples of why to use this technique in your error handling.</p><h3 id="error-handling-in-powershell---best-practices" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#error-handling-in-powershell---best-practices"/><a href="https://vexx32.github.io/2019/01/31/PowerShell-Error-Handling/"><em>Error Handling in PowerShell - Best Practices</em></a><a class="ps-heading-anchor" href="#error-handling-in-powershell---best-practices" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Joel (Sallow) Francis January 31</p><p>Terminating errors? Non-Terminating errors? Joel explains them both and how to handle them in your code.</p><h3 id="reddit-rpowershell---most-popular-weekly-post" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#reddit-rpowershell---most-popular-weekly-post"/><a href="https://www.reddit.com/r/PowerShell/comments/algkuo/listing_office365_outages/?st=jrl8papk&amp;sh=3e8672fc"><em>Reddit /r/PowerShell - Most Popular Weekly Post</em></a><a class="ps-heading-anchor" href="#reddit-rpowershell---most-popular-weekly-post" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Listing Office365 Outages</p><h3 id="tweet-of-the-week" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#tweet-of-the-week"/><a href="https://twitter.com/Steve_MSFT/status/1090393625781972992"><em>Tweet of the Week</em></a><a class="ps-heading-anchor" href="#tweet-of-the-week" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>What are some cool things you&rsquo;ve added to your prompt?</p><h3 id="set-clipboard---using-powershell-to-read-and-set-the-clipboard-in-windows" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190201.md#set-clipboard---using-powershell-to-read-and-set-the-clipboard-in-windows"/><a href="https://www.youtube.com/watch?v=TBRdvzcxS54"><em>Set-Clipboard - Using PowerShell to read and set the clipboard in Windows</em></a><a class="ps-heading-anchor" href="#set-clipboard---using-powershell-to-read-and-set-the-clipboard-in-windows" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>John Impallomeni showing some clipboard magic from Powershell.</p>
]]></content:encoded></item></channel></rss>