&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 August 2019 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2019/08/</link><description>Recent content in Articles from August 2019 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2019/08/index.xml" rel="self" type="application/rss+xml"/><item><title>A Better Way To Search Events</title><link>https://powershell.org/articles/2019-08-30-a-better-way-to-search-events/</link><guid>https://powershell.org/articles/2019-08-30-a-better-way-to-search-events/</guid><pubDate>Fri, 30 Aug 2019 17:09:21 +0000</pubDate><description>&lt;p&gt;I have put together a security script to use as an alerting system. Using a CSV file containing information on which users are assigned which computer, the event logs are searched to discover when a user signs into a device outside their normal assignments. The final result of that script can be viewed &lt;a href="https://github.com/tobor88/BTPS-SecPack/blob/master/Event%20Alerts/UnusualUserSignInAlert.ps1"&gt;HERE&lt;/a&gt; if interested. I will do my best to provide unique real world search queries for my examples.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I have put together a security script to use as an alerting system. Using a CSV file containing information on which users are assigned which computer, the event logs are searched to discover when a user signs into a device outside their normal assignments. The final result of that script can be viewed<a href="https://github.com/tobor88/BTPS-SecPack/blob/master/Event%20Alerts/UnusualUserSignInAlert.ps1">HERE</a> if interested. I will do my best to provide unique real world search queries for my examples.</p><p>In order to accomplish this task, I originally believed I was going to need to search the event logs based on user and computer. Although this turned out to not be the case I figured it was a pretty useful thing to figure out how to do. That is the task that led me here.</p><p>The best way to search events is using the<a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-winevent?view=powershell-6">Get-WinEvent</a> cmdlet. This method is far superior to<a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-eventlog?view=powershell-5.1">Get-EventLog</a> in both speed and filtering ability. The documentation for the Filter Hash related parameters are a little lacking.</p><p>When searching events you will want to keep in mind that each event source is handled as a document containing a sequence of events. Windows Event Log uses query expressions based on a subset of XPath 1.0 for selecting events from their sources. When you specify a query, you are also specifying an event channel for the context of the query. When you select an event with an event query, the entire event is selected, not a portion of the event information.</p><p><strong>FILTERHASHTABLE</strong></p><p>The FilterHashTable parameter is probably the most straight forward to use. I have taken the below example from Microsoft&rsquo;s TechNet site as this Paramter is the most straight foward and easy to use. The format is easy to understand as we are searching for an array of properties. To accurately describe these properties, it is easiest to view the events in Event Viewer.</p><p><code>$StartTime = (Get-Date).AddDays(-7) Get-WinEvent -FilterHashtable@{ Logname='Application'; ProviderName='Application Error'; Data='iexplore.exe'; StartTime=$StartTime }</code>If you have experience with the<a href="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/New-Object?view=powershell-6">New-Object</a> cmdlet you have most likely added properties to the newly created object in this same fashion. Looking at the list of available property queries below, we are not able to search by computer name. I checked to see what other options were available. Data below is showing as an array. I have known this option to allow the entering of an SID or a username to query the event log. I have not been able to successfully add multiple properties into that value.</p><ul><li><strong>LogName</strong>=</li><li><strong>ProviderName</strong>=</li><li><strong>Path</strong>=</li><li><strong>Keywords</strong>=</li><li><strong>ID</strong>=</li><li><strong>Level</strong>=</li><li><strong>StartTime</strong>=</li><li><strong>EndTime</strong>=</li><li><strong>UserID</strong>=</li><li><strong>Data</strong>=</li><li><code>=</code>*<strong>SuppressHashFilter</strong>=`Below is a FilterHashTable query that searches the Sysmon events for all Network connections that happened over the last 1.2 hours.</li></ul><p><code>Get-WinEvent -MaxEvents 1 -FilterHashtable @{LogName="Microsoft-Windows-Sysmon/Operational"; Id=3; StartTime=(Get-Date).AddHours(-1.2)}</code><strong>FILTERXPATH</strong></p><p>The next parameter defined is the FilterXPath parameter. This ended up being the one I used because it required less typing than FilterXML. More on this towards the end of the juicy stuff we are about to get into. To ensure the correct information is being used open the Event Viewer, (eventvwr.msc) and go to the XML view of the event you wish to query. In my case it was Security Event ID 4624.Below is a sample of the xml format for this event.</p><p>`4624
1
0
12544
0
0x8020000000000000</p><p>53282</p><p>Security
DC1</p><h2 id="00000000-0000-0000-0000-000000000000" class="ps-heading">S-1-5-0 ####
david.haller
LEGION
0x3e7
S-1-5-21-1005
david.haller
LEGION
0x33648
2
I_Am_God
Negotiate
Why-Is-It-Blue
{00000000-0000-0000-0000-000000000000}<a class="ps-heading-anchor" href="#00000000-0000-0000-0000-000000000000" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ul><li/></ul><p>0 0x210
C:\Windows\System32\winlogon.exe
10.0.0.8 0
%%1833</p><p>`===============================================================</p><p>Microsoft has given us this syntax:<code>Get-WinEvent -FilterXPath "*[System[Level=3 and TimeCreated[timediff(@SystemTime) &lt;= 86400000]]]"</code></p><p>This starts with a wildcard character which I have to apologize I do not remember the significance of. Each XML section is enclosed inside a set of [ ]. Starting small, If we wanted to query the &lsquo;<strong>System</strong>&rsquo; section and the &lsquo;<strong>EventData</strong>&rsquo; section it would look like the this.</p><p><code>$XPath = '*[System[] and EventData[]]'</code>To define the properties we wish to search for we need to add those properties inside the set of brackets for<strong>System</strong> and or<strong>EventData</strong>. I am going to add on to what we have defined so far. The event id is an integer. Because it is an integer we do not want to add single quotes around the value.</p><p><code>$XPath = '*[System[EventID=4624] and EventData[]]'</code>Adding to the &ldquo;<strong>EventData</strong>&rdquo; gets a little more tricky. In the XML format above you can see that a property has been defined for the XML tags and each tag is called Data. Following the format at this TechNet reference:<a href="https://docs.microsoft.com/en-us/previous-versions//aa385231(v=vs.85)">https://docs.microsoft.com/en-us/previous-versions//aa385231(v=vs.85)</a>, we are able to view how to define this type of property. I placed a variable in the value field to demonstrate the need for single quotes as this is a string and single quotes are expected in order for the query to work.</p><p><code>$SamAccountName = 'Amahl.Farouk'; Get-WinEvent -FilterXPath "*[System[EventID=4624] and EventData[Data[@Name='TargetUserName']='$SamAccountName']"']]</code>To add a second field to query the System section is fairly straight forward. To accomplish this we need to follow the last value with &lsquo;and&rsquo; and add the new property as can be seen from the original Microsoft TechNet example. For those of you are unfamliar there are 86400000 seconds in 24 hours. So the time created value below gets the current system time and queries events that are less than or equal to a day old.</p><p><code>$XPath = "*[System[EventID=4624 and TimeCreated[timediff(@SystemTime) &lt;= 86400000 ]] and EventData[Data[@Name='TargetUserName']='$SamAccountName']"</code>Now We are searching for Event ID 4624, over the last 24 hours containing a specific username. Time to add the IP Address property. In the event log this value has an IP address and the computer&rsquo;s name was not able to be found. I have a list of computer names so I will need to convert those names to IP addresses for my query to be successful. This meant for my script, that a<a href="https://docs.microsoft.com/en-us/powershell/module/dnsclient/resolve-dnsname?view=win10-ps">Resolve-DnsName</a> cmdlet had to be used to get the required value. There are numbers in this value but it is still not an integer so we are going to need single quotes around the value again.</p><p><code>$XPath = "*[System[EventID=4624 and TimeCreated[timediff(@SystemTime) &lt;= 86400000]] and EventData[Data[@Name='TargetUserName']='$SamAccountName'] and EventData[Data[@Name='IpAddress']='$IPv4Address']]"</code>As you can see above, in order to successfully query the computer value and TargetUsername in the EventData XML tags we needed to add a second &ldquo;and EventData&rdquo;. This successfully finds what I was looking for.</p><p>**FI
LTERXML
**</p><p>FilterXML was another possible option that could have been used. In Microsoft&rsquo;s TechNet Documentation, one of the examples they gave was as follows.</p><p><code># Using the FilterXML parameter: PS&gt; Get-WinEvent -FilterXML "*[System[Level=3 and TimeCreated[timediff(@SystemTime)&lt;= 86400000]]]"</code>I should mention you can easily get yourself started with the -FilterXML value using Windows Event Viewer. Simply open Windows Event Viewer, in the right hand pane select &ldquo;<strong>Create Custom View</strong>&rdquo; than enter the Event ID values you wish to search for, keywords, time frames, computer names, etc. Then click the XML tab and it will show you what the XML query looks like. This is great for getting started however it will not work for more detailed queries which I will build on in the information below.</p><p>To query the Event Log using the FilterXML parameter we need to add the QueryList and Query tags on the outside of the defining properties we wish to filter by. Using -FilterXML is simply XML formatted text of what we are looking for. The same sectioning rules apply as before except FilterXML wants an XML formatted document when FilterXPath wants just the properties defined. The XPath 1.0 language Windows uses must resolve to &ldquo;Events&rdquo; not a single &ldquo;Event&rdquo;. This seemed to make the most sense for my original situation so it is what I went with. </p><p>Why would these two similar options be available for use you might question?!?!?! The Windows Event log does not fully support XPath query language. More information on this can be read<a href="https://docs.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations">HERE</a>
and<a href="https://docs.microsoft.com/en-us/windows/win32/wes/consuming-events#limitations">HERE</a>
if interested. Windows Event Log uses a subset of XPath 1.0. There are specific limitations of XPath 1.0. The more options available the better the chance you are able to find what you are looking for using this cmdlet. Below we can view an example of why we need to have these two query parameters.</p><p>I wanted to build a query that returns services I do not have record of or know about. To do this I need to filter out known services. Although this list of services below can be extended greatly there is a max limit of 32 expressions that can be added to the XPath query. If you exceed this limit you will receive the PowerShell error message &ldquo;<em>Get-WinEvent : The specified query is invalid</em>&rdquo;. This prevents my ability to accomplish this task.<br>
If you run the below query you will notice that it returns every Event ID under the sun after filtering the one Event ID I am trying to return information on.</p><p>`$FilterXML = @"</p><pre><code> *[System[(EventID="7045")]]</code></pre><p>and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;MpKslDrv&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Microsoft Edge Update Service (edgeupdate)&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Microsoft Edge Update Service (edgeupdatem)&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Microsoft Edge Elevation Service (MicrosoftEdgeElevationService)&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Wireless Keyboard Filter Device Service&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;FileSyncHelper&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;OneDrive Updater Service&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Google Update Service (gupdatem)&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Google Update Service (gupdate)&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Google Chrome Elevation Service&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Adobe Genuine Monitor Service&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Adobe Genuine Software Integrity Service&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;AdobeUpdateService&rdquo;]]
and *[EventData[Data[@Name=&ldquo;ServiceName&rdquo;]!=&ldquo;Mozilla Maintenance Service&rdquo;]]</p><p>&ldquo;@
Get-WinEvent -FilterXML $FilterXML
`You are able to add Suppress tags to remove Event ID&rsquo;s you do not want returned. Under other circumstances this can work. For the goal of the above query, I will need over 32 &lsquo;Suppress&rsquo; tags to filter Event ID&rsquo;s I do not want returned. If you run into a situation such as the one above you<strong>DO NOT NEED</strong> to add the Suppress tags. Simply use the -FilterXPath parameter instead. This would turn my above query into this:</p><p><code>$XPath = '*[System[(EventID="7045")]] and [EventData[Data[@Name="ServiceName"]!="MpKslDrv"]] and [EventData[Data[@Name="ServiceName"]!="Action1 Agent"]] and [EventData[Data[@Name="ServiceName"]!="Microsoft Edge Update Service (edgeupdate)"]] and [EventData[Data[@Name="ServiceName"]!="Microsoft Edge Update Service (edgeupdatem)"]] and [EventData[Data[@Name="ServiceName"]!="Microsoft Edge Elevation Service (MicrosoftEdgeElevationService)"]] and [EventData[Data[@Name="ServiceName"]!="Microsoft Update Health Service"]] and [EventData[Data[@Name="ServiceName"]!="Sysmon"]] and [EventData[Data[@Name="ServiceName"]!="SysmonDrv"]] and [EventData[Data[@Name="ServiceName"]!="Wireless Keyboard Filter Device Service"]] and [EventData[Data[@Name="ServiceName"]!="FileSyncHelper"]] and [EventData[Data[@Name="ServiceName"]!="OneDrive Updater Service"]] and [EventData[Data[@Name="ServiceName"]!="Splashtop Software Updater Service"]] and [EventData[Data[@Name="ServiceName"]!="Splashtop Virtual Hid"]] and [EventData[Data[@Name="ServiceName"]!="Google Update Service (gupdatem)"]] and [EventData[Data[@Name="ServiceName"]!="Google Update Service (gupdate)"]] and [EventData[Data[@Name="ServiceName"]!="Google Chrome Elevation Service"]] and [EventData[Data[@Name="ServiceName"]!="Adobe Genuine Monitor Service"]] and [EventData[Data[@Name="ServiceName"]!="Adobe Genuine Software Integrity Service"]] and [EventData[Data[@Name="ServiceName"]!="AdobeUpdateService"]] and [EventData[Data[@Name="ServiceName"]!="Mozilla Maintenance Service"]]' Get-WinEvent -FilterXPath $XPath</code>The query must have at least one select statement. For each suppress statement, there must be at least one select statement that specifies the same path. If the select and suppress query return the same events, the suppress statement takes precedence. If you select events from multiple sources, the events are returned in time stamp order. If you use the system time stamp and the rate of events is high, it is possible that more than one event will have the same time stamp. When this occurs, the ordering of events becomes ambiguous and the events may appear out of order. Be careful when comparing floating point numbers in XPath queries. Any string representation of a floating point number is approximated and the value displayed in XML might not match the number stored with the event. Floating point numbers should be compared as being less than or greater than a constant.<br>
If you are required to use XML filtering for your situation my conclusion so far is that you need to know what you are looking for. As far as I am aware there is not a solution to perform the above kind of process of elimination without manual overview or FilterXPath.<br>
To compensate for this in my own environment, (where I have centralized important events using Windows Event Forwarding), I import centralized events into a SQL database and perform queries there. There are a lot of benefits to this including speed. If you wish to use the tool I created for this it can be obtained from<a href="https://github.com/tobor88/BTPS-SecPack/tree/master/WEF%20Application">HERE</a>. I have set up instructions<a href="https://btps-secpack.com/wef-application">HERE</a> if you wish to use the application as well.<br>
The &ldquo;Suppress&rdquo; &lsquo;<a href="https://docs.microsoft.com/en-us/windows/win32/wes/queryschema-elements">Query Schema Element</a>&rsquo; I mentioned can be used to filter out the extra Event ID&rsquo;s returned by a query. There is a limit of 32 expressions for the &lsquo;Suppress&rsquo; tags as well.  The below example is used to query the event logs for any user accounts that have been added to high privileged administrator groups. The &lsquo;Suppress&rsquo; expression is used to filter out Event ID 4799, preventing the return of unwanted information</p><p>`$FilterXML = @&rdquo;</p><p>(<em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Administrators&rdquo;]]) or
(</em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Domain Admins&rdquo;]]) or
(<em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Schema Admins&rdquo;]]) or
(</em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Enterprise Admins&rdquo;]]) or
(<em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Print Operators&rdquo;]]) or
(</em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Server Operators&rdquo;]]) or
(<em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;DnsAdmins&rdquo;]]) or
(</em>[EventData[Data[@Name=&ldquo;TargetUserName&rdquo;] = &ldquo;Backup Operators&rdquo;]])
and
*[System[(EventID=&lsquo;4732&rsquo;) or (EventID=&lsquo;4733&rsquo;) or (EventID=&lsquo;4756&rsquo;) or (EventID=&lsquo;4757&rsquo;) or (EventID=&lsquo;4728&rsquo;) or (EventID=&lsquo;4729&rsquo;)]]</p><p>*[System[(EventID=4799)]]</p><p>&ldquo;@
Get-WinEvent -FilterXML $FilterXML
`Another query you might find useful is one that searches the event log for an instance where the local Administrator user entered a password to execute a process with elevated privileges over the last 24 hours.</p><p>`$XML = "</p><p>            *[System[(EventID=4648) and TimeCreated[timediff(@SystemTime) &lt;= 86400000]] and EventData[Data[@Name=&lsquo;ProcessName&rsquo;]=&lsquo;C:\Windows\System32\consent.exe&rsquo;] and EventData[Data[@Name=&lsquo;TargetUserName&rsquo;]=&lsquo;Administrator&rsquo;]]</p><p>"
$AdminConsentGiven = Get-WinEvent -FilterXml $XML -MaxEvents 1 | Select-Object -Property *
`It is suggested to use XPath queries when you are searching the event logs for a simple expression from a single source. Use an XML structured query when you are searching from more than one event log source or you are using a compound expression with a dozen or more expressions.</p><p>Another example Microsoft gives for filtering events involves the<a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/where-object?view=powershell-6"> Where-Object</a> cmdlet. The overhead on Where-Object is fairly high so I try to avoid using it whenever I can as it will search through everything a second time and can noticeably slow down the execution time of a script. I hope you found this useful and were able to learn what I was able to through this. Until next time&hellip;</p><ul><li><a href="https://roberthosborne.com">tobor</a></li></ul>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 30-August-2019</title><link>https://powershell.org/articles/2019-08-30-icymi-powershell-week-of-30-august-2019/</link><guid>https://powershell.org/articles/2019-08-30-icymi-powershell-week-of-30-august-2019/</guid><pubDate>Fri, 30 Aug 2019 15:21:52 +0000</pubDate><description>&lt;p&gt;Topics include DNS, GUI&amp;rsquo;s, automation of legacy tools, Azure test environment setups and more!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include DNS, GUI&rsquo;s, automation of legacy tools, Azure test environment setups and more!</p><p>Special thanks to Kevin Laux, Prasoon Karunan V, and Robin Dadswell.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://evotec.xyz/comparing-two-or-more-objects-visually-in-powershell-cross-platform/"><em>Comparing two or more objects visually in PowerShell</em></a></p><p>by Przemyslaw Klys on 25th August</p><p>Compare-Object is good, but how about comparing multiple objects and seeing the results in an easy to see format!</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://cirriustech.co.uk/blog/create-dynamic-dns-azure-dns-pt2"><em>Create your own Dynamic DNS service using Azure DNS - part 2</em></a></p><p>by Graham Gold on 26th August</p><p>Use a very lightweight updater client (windows or linux) that uses an Azure PowerShell function to update the DNS record-set entry.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://adamtheautomator.com/build-powershell-gui/"><em>How to Build a PowerShell GUI for your Scripts</em></a></p><p>by June Castillote on 26th August</p><p>PowerShell is a command-line tool but did you know it can also be used as a base for graphical interfaces? Sometimes command-line isn&rsquo;t the best kind of interface for a particular instance. Building a PowerShell GUI for for your service desk is a great example. This is one of those times when it is more appropriate to build graphical tools instead.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://devblogs.microsoft.com/scripting/automating-quser-through-powershell/"><em>Automating Quser through PowerShell</em></a></p><p>by Dan Reist on 27th August</p><p>I need to log a user off every computer they’re logged into. The problem is, I don’t know which ones. How can I discover which computers they’re logged into and then log them off?</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://nocolumnname.blog/2019/08/28/splitting-functions-from-scripts-in-bulk/"><em>Splitting Functions from Scripts in bulk</em></a></p><p>by Shane O&rsquo;Neill on 28th August</p><p>Ever wanted to use some of the functions within a script and easily call them? Turns out it is incredibly easy, find out more with Shane.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://twitter.com/Steve_MSFT/status/1166801611781312512"><em>Tweet of the Week</em></a></p><p>A call out from Steve for what we want to be blogged about.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://www.youtube.com/watch?v=YAF1sHYAwBY"><em>Youtube: Title of Youtube Video</em></a></p><p>From the London PSUG, Naw explains in great detail and with passion what he created at The British Museum to automate the setup of test environments using Azure PowerShell, Pester (Unit Test &amp; Infrastructure Test), Azure DevOps/Pipeline.</p>]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 23-August-2019</title><link>https://powershell.org/articles/2019-08-23-icymi-powershell-week-of-23-august-2019/</link><guid>https://powershell.org/articles/2019-08-23-icymi-powershell-week-of-23-august-2019/</guid><pubDate>Fri, 23 Aug 2019 15:00:41 +0000</pubDate><description>&lt;p&gt;Topics include PowerShell 7 Preview 3, Universal Dashboard, URI Data Types and more.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include PowerShell 7 Preview 3, Universal Dashboard, URI Data Types and more.</p><p>Special thanks to Robin Dadswell, Mark Roloff, Prasoon Karunan V, and Kevin Laux.</p><h3 id="how-to-combine-the-elements-of-two-arrays-using-powershell" class="ps-heading"><a href="https://dotnet-helpers.com/powershell/how-to-combine-the-elements-of-two-arrays-using-powershell/?fbclid=IwAR2VMOInc6GwiZ4BiPVE46Fn-vQcQLCF5F-AgLSiAkq_XsD1rf0Nbje29rc" title="https://dotnet-helpers.com/powershell/how-to-combine-the-elements-of-two-arrays-using-powershell/?fbclid=IwAR2VMOInc6GwiZ4BiPVE46Fn-vQcQLCF5F-AgLSiAkq_XsD1rf0Nbje29rc">How to combine the elements of two arrays using PowerShell</a><a class="ps-heading-anchor" href="#how-to-combine-the-elements-of-two-arrays-using-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>by Thiyagu on 18th of August</p><p>Information on the different ways to join Arrays depending on the scenario.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://devblogs.microsoft.com/powershell/powershell-7-preview-3/">PowerShell 7 Preview 3 | PowerShell</a></p><p>by Steve Lee on 20th of August</p><p>The new preview (3) for PowerShell 7 is available.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://devblogs.microsoft.com/powershell/new-telemetry-in-powershell-7-preview-3/">New Telemetry in PowerShell 7 Preview 3 | PowerShell</a></p><p>by Sydney Smith on 20th of August</p><p>Additional telemetry data points will be collected starting with PowerShell 7 Preview 3, find out what they are and how to toggle them off if needed.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://mikefrobbins.com/2019/08/21/parallel-and-throttlelimit-parameters-added-to-foreach-object-in-powershell-7-preview-3/">Parallel and ThrottleLimit Parameters added to ForEach-Object in PowerShell 7 Preview 3</a></p><p>by Mike F Robbins on 21st of August</p><p>Preview 3 of PowerShell 7 was just released. ForEach-Object now has Parameters for Parallel and ThrottleLimit.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://www.imab.dk/sccm-client-health-monitor-script/">SCCM Client Health Monitor Script - imab.dk</a></p><p>by Martin Bengtsson</p><p>The SCCM Client Health Monitor Script is a PowerShell script which fixes common issues related to SCCM client health.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://www.reddit.com/r/PowerShell/comments/crlmhy/i_bet_you_all_have_been_doing_this_for_years_but/"><em>Reddit /r/PowerShell - Most Popular Weekly Post</em></a></p><p>Using URI Data types instead of strings.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://twitter.com/pewa2303/status/1163306192392859649?s=21"><em>Tweet of the Week</em></a></p><p>PowerShell: Implementing a Progress Bar with Write-Progress</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://youtu.be/6eOjRQi4vUU">Data to Dashboard in under an hour with Universal Dashboard! with Adam Driscoll</a></p><p>Adam Driscoll explores his tool Universal Dashboard, learn how to take advantage of a Powerful PowerShell tool</p>]]></content:encoded></item><item><title>A Peculiar Parse</title><link>https://powershell.org/articles/2019-08-20-a-peculiar-parse/</link><guid>https://powershell.org/articles/2019-08-20-a-peculiar-parse/</guid><pubDate>Tue, 20 Aug 2019 19:40:17 +0000</pubDate><description>&lt;h2 id="heading" class="ps-heading wp-block-heading"&gt; &lt;a class="ps-heading-anchor" href="#heading" 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;One of the best enhancements to Powershell was the inclusion of custom classes in v5. We originally wrote scripts, then we wrote cmdlets, followed by modules, and now we&amp;rsquo;ve graduated, with Class.&lt;/p&gt;
&lt;p&gt;I recently decided I wanted to write some code that would build a website. What better way to do that than by creating a class just for me? That&amp;rsquo;s rhetorical by the way. My early class code looked like this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<h2 id="heading" class="ps-heading wp-block-heading"> <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></h2><p>One of the best enhancements to Powershell was the inclusion of custom classes in v5. We originally wrote scripts, then we wrote cmdlets, followed by modules, and now we&rsquo;ve graduated, with Class.</p><p>I recently decided I wanted to write some code that would build a website. What better way to do that than by creating a class just for me? That&rsquo;s rhetorical by the way. My early class code looked like this:</p><p><code>class mysite { [string]$SiteName = 'mysite' [string]$PhysPath = 'c:\mysite' [string]$Binding = '*:8000:' mysite(){ Import-Module IISAdministration,WebAdministration } [void]CreateSite(){ $newsite = @{ Name = $this.SiteName PhysicalPath = $this.PhysPath BindingInformation = $this.Binding } New-IISSite @newsite (Get-IISServerManager).CommitChanges() } }</code>With this code I&rsquo;m able to create my IIS website and see it in IIS Manager. But then I thought it&rsquo;d be great to add the object representing the new site to my custom class. To do this I&rsquo;ll need to create another property. It&rsquo;s generally a good idea to cast properties as the appropriate object type.  That means adding a new property to the class and loading the appropriate namespaces so the casting would work.  I also updated my method to pass the object representing my website to the new property.</p><p><code>class mysite { [string]$SiteName = 'mysite' [string]$PhysPath = 'c:\mysite' [string]$Binding = '*:8000:' [Microsoft.Web.Administration.Site[]]$SiteObject mysite(){ [void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Administration') [void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Management') Import-Module IISAdministration,WebAdministration } [void]CreateSite(){ $newsite = @{ Name = $this.SiteName PhysicalPath = $this.PhysPath BindingInformation = $this.Binding } $this.SiteObject += New-IISSite @newsite -Passthru (Get-IISServerManager).CommitChanges() } }</code>Looks great right?  I was able to create my new site and see it in IIS Manager.  The next day I wanted to try it out again so I deleted my website, loaded my code, and then got hit with a nasty error from the parser.</p><p><img src="https://scontent.xx.fbcdn.net/v/wl/t1.15752-0/s480x480/69283328_2866413096703634_4259896023284973568_n.png?_nc_cat=104&amp;_nc_log=1&amp;_nc_oc=AQnsep46eWke901Uzia9GmY3zbuEAnbk9WImb3IVthQegbzYfeL8zjSXiEj6381xEfXtbK1gLIP9kNUgzJ-kXykw&amp;_nc_ht=scontent.xx&amp;oh=95f0b7ade60da2b13897597e64bfdc4f&amp;oe=5DD64557" alt=""/><p>`PS C:\Dev&gt; . .\powershellorg.ps1
At C:\Dev\powershellorg.ps1:5 char:4</p><ul><li>[Microsoft.Web.Administration.Site[]]$SiteObject</li><li><pre tabindex="0"><code/></pre></li></ul><p>Unable to find type [Microsoft.Web.Administration.Site].
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : TypeNotFound
`Turns out, the parser in powershell is reading my code and sees an object type it doesn&rsquo;t know.  That would be my new property with the casting to [Microsoft.Web.Administration.Site].  At this point, the namespace containing the class I&rsquo;m casting as hasn&rsquo;t been loaded because that code is in the class constructor.  So I figure, no problem!  I&rsquo;ll just load the namespaces before I define my class, score one point for Colyn!</p><p><code>[void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Administration') [void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Management') class mysite { [string]$SiteName = 'mysite' [string]$PhysPath = 'c:\mysite' [string]$Binding = '*:8000:' [Microsoft.Web.Administration.Site[]]$SiteObject mysite(){ Import-Module IISAdministration,WebAdministration } [void]CreateSite(){ $newsite = @{ Name = $this.SiteName PhysicalPath = $this.PhysPath BindingInformation = $this.Binding } $this.SiteObject += New-IISSite @newsite -Passthru (Get-IISServerManager).CommitChanges() } }</code>Or so I thought, as it turns out I still receive the same exception.  Going back to my troubleshooting skills I stepped through my code in the ISE, without exception.  Wait, what?  That&rsquo;s right, there was no exception when I stepped through my code.  Thinking I might have fat fingered my code, or maybe didn&rsquo;t save correctly, I tried again.  Same error.</p><p>Upon further research I discovered that the parsing protocol in powershell doesn&rsquo;t read linearly.  In its early passes over my code it observed I was creating a class and decided to load the class first.  Because the [mysite] class is loading before my reflection calls, the code bombs.  +1 for non linear dynamics.  This is true even when implementing the &lsquo;using namespace&rsquo; capability that launched with v5:</p><p><code>using namespace Microsoft.Web.Administration; using namespace Microsoft.Web.Management; class mysite { [string]$SiteName = 'mysite' [string]$PhysPath = 'c:\mysite' [string]$Binding = '*:8000:' [Microsoft.Web.Administration.Site[]]$SiteObject mysite(){ Import-Module IISAdministration,WebAdministration } [void]CreateSite(){ $newsite = @{ Name = $this.SiteName PhysicalPath = $this.PhysPath BindingInformation = $this.Binding } $this.SiteObject += New-IISSite @newsite -Passthru (Get-IISServerManager).CommitChanges() } }</code>I determined two ways around this problem.  The first was to keep the class in a separate file, but create a new .ps1 file that would load the dependent namespaces and then use dot sourcing to load the class file.  I did a quick experiment to test this assumption which gave positive reinforcement for the idea:</p><p><img src="https://scontent.xx.fbcdn.net/v/wl/t1.15752-0/s480x480/68576638_490740718161416_4996682901111177216_n.png?_nc_cat=108&amp;_nc_log=1&amp;_nc_oc=AQkZ0I7swgdlk0kzRJoAdY15EGff-nFrtXlSm8-wdGcmEnR3-P_Aa6STzf3v2TiOOReuw2c7x0Q3XWpjIbuLyvAh&amp;_nc_ht=scontent.xx&amp;oh=896b4925e9a6a684a06ba200a974802b&amp;oe=5DD6844A" alt=""/><p>Of course the polymorphism of powershell allows a less cumbersome and equally less exact solution.  I can simply recast the property as a generic object.</p><p><code>class mysite { [string]$SiteName = 'mysite' [string]$PhysPath = 'c:\mysite' [string]$Binding = '*:8000:' [Object[]]$SiteObject mysite(){ [void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Administration') [void][System.Reflection.Assembly]::LoadWithPartialName( 'Microsoft.Web.Management') Import-Module IISAdministration,WebAdministration } [void]CreateSite(){ $newsite = @{ Name = $this.SiteName PhysicalPath = $this.PhysPath BindingInformation = $this.Binding } $this.SiteObject += New-IISSite @newsite -Passthru (Get-IISServerManager).CommitChanges() } }</code>As with anything in Powershell or coding in general, there&rsquo;s always more than one way to achieve a goal.  The lesson learned in this experience is that custom classes will always be loaded ahead of the rest of your code.  You can work around this by abstracting your classes to a separate file or &ldquo;library&rdquo; to ensure your code executes in the order you intend.  If you get a TypeNotFound error from a casting call in your class, you can use the code abstraction method or simply recast to a default but similar type.</p>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 16-August-2019</title><link>https://powershell.org/articles/2019-08-16-icymi-powershell-week-of-16-august-2019/</link><guid>https://powershell.org/articles/2019-08-16-icymi-powershell-week-of-16-august-2019/</guid><pubDate>Fri, 16 Aug 2019 15:00:40 +0000</pubDate><description>&lt;p&gt;Topics include Azure setups, AD reporting, IF statements Out-GridView and other new features coming in PowerShell 7.&lt;/p&gt;
&lt;p&gt;Special thanks to James Petty, Mark Rollof, Prasoon Karunan V and Robin Dadswell&lt;/p&gt;
&lt;h3 id="" class="ps-heading"&gt;&lt;a class="ps-heading-anchor" href="#" 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;&lt;a href="https://www.linkedin.com/pulse/pragmatic-powershell-scripting-chris-sharp/"&gt;&lt;em&gt;Pragmatic PowerShell Scripting - Reporting on AD Groups&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;by Chris Sharp on 11th August&lt;/p&gt;
&lt;p&gt;Learn how Chris approached a requirement to pull various reports from AD using PowerShell and a useful Excel module.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include Azure setups, AD reporting, IF statements Out-GridView and other new features coming in PowerShell 7.</p><p>Special thanks to James Petty, Mark Rollof, Prasoon Karunan V and Robin Dadswell</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://www.linkedin.com/pulse/pragmatic-powershell-scripting-chris-sharp/"><em>Pragmatic PowerShell Scripting - Reporting on AD Groups</em></a></p><p>by Chris Sharp on 11th August</p><p>Learn how Chris approached a requirement to pull various reports from AD using PowerShell and a useful Excel module.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://powershellexplained.com/2019-08-11-Powershell-if-then-else-equals-operator/"><em>Powershell: Everything you wanted to know about the IF statement</em></a></p><p>by Kevin Marquette on 11th August</p><p>Like many other languages, PowerShell has statements for conditionally executing code in your scripts. One of those statements is the if statement. Today we will take a deep dive into one of the most fundamental commands in PowerShell.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="http://www.thatlazyadmin.com/create-an-azure-storage-account-using-powershell/"><em>Create an Azure Storage account using PowerShell</em></a></p><p>by Shaun Hardneck on 13th August</p><p>In this short post, I will show you how you can create a new Azure Storage Account using PowerShell.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://devblogs.microsoft.com/powershell/out-gridview-returns/"><em>Out-GridView Returns!</em></a></p><p>by Jack Zeiders on 14th August</p><p>It’s been almost 3 years since PowerShell Core debuted for Linux and Mac, and as we’ve increased our cmdlet coverage more and more, one cmdlet has always stood out as a top, cross-platform request. Today, we are excited to announce that Out-GridView is debuting on all Core-supported platforms through the GraphicalTools Module.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://adamtheautomator.com/azure-lab-setup"><em>Automating an Azure Lab Setup with PowerShell</em></a></p><p>by Adam Bertram on 15th August</p><p>Ever wanted to learn how to boot up an entire Lab with a single line of PowerShell, well Adam Bertram can show you how with this post.</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="vscode-resource:/c:/Users/robin/OneDrive%20-%20Dadswell.Net/Software/Stuff%20I%20Have%20Written/repo/PowerShell_Org/WhatYouMissedThisWeek/URL"><em>Reddit /r/PowerShell - Most Popular Weekly Post</em></a></p><p>Description of Reddit topic</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://twitter.com/Steve_MSFT/status/1161666852914778113"><em>Tweet of the Week</em></a></p><p>Coming in PowerShell 7 Preview.3 is </p><p><code>ForEach-Object -Parallel</code>experimental feature! Easily execute scriptblocks in parallel threads!</p><h3 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p><a href="https://www.youtube.com/watch?v=cK1xenkF9zs"><em>Youtube: PowerShell Community Call - August 15, 2019</em></a></p><p>An overview of upcoming changes, some information and a Q&amp;A session.</p>
]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 9-August-2019</title><link>https://powershell.org/articles/2019-08-09-icymi-powershell-week-of-9-august-2019/</link><guid>https://powershell.org/articles/2019-08-09-icymi-powershell-week-of-9-august-2019/</guid><pubDate>Fri, 09 Aug 2019 23:00:02 +0000</pubDate><description>&lt;p&gt;Topics include SharePoint, AD trust relationships, Azure File Sync, working with variables and more.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include SharePoint, AD trust relationships, Azure File Sync, working with variables and more.</p><p>Special thanks to Prasoon Karunan V and Robin Dadswell</p><h6 id="introducing-the-azure-file-sync-dsc-resource-module.wp-block-heading" class="ps-heading"><a href="http://www.powershell.no/powershell,/azure/2019/08/04/azure-filesync-dsc.html"><em>Introducing the Azure File Sync DSC resource module</em></a><a class="ps-heading-anchor" href="#introducing-the-azure-file-sync-dsc-resource-module.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Jan Egil Ring on 4th August</p><p>Introduction to a new PowerShell DSC resource module called AzureFileSyncDsc. Including an overview of what Azure File Sync is.</p><h6 id="monitor-web-server-uptime-with-a-powershell-script.wp-block-heading" class="ps-heading"><a href="https://4sysops.com/archives/monitor-web-server-uptime-with-a-powershell-script/"><em>Monitor web server uptime with a PowerShell script</em></a><a class="ps-heading-anchor" href="#monitor-web-server-uptime-with-a-powershell-script.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Adam Bertram on 4th August</p><p>There are many different tools to monitor whether a web server is running or not. However, if you and/or your team know PowerShell and, perhaps, already have some PowerShell scripts to manage web services, using PowerShell to monitor uptime may be a good option.</p><h6 id="testing-ldap-and-ldaps-connectivity-with-powershell.wp-block-heading" class="ps-heading"><a href="https://evotec.xyz/testing-ldap-and-ldaps-connectivity-with-powershell/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=testing-ldap-and-ldaps-connectivity-with-powershell"><em>Testing LDAP and LDAPS connectivity with PowerShell</em></a><a class="ps-heading-anchor" href="#testing-ldap-and-ldaps-connectivity-with-powershell.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Przemyslaw Klys on 4th August</p><p>One of the common ways to connect to Active Directory is thru LDAP protocol. There are a lot of applications that talk to AD via LDAP. By default Active Directory has LDAP enabled but that&rsquo;s a bit insecure in today&rsquo;s world. That&rsquo;s where LDAPS comes in. It&rsquo;s not easy to set up, but when you get it done, it works. The problem I had recently is that while setting up LDAPS on DC&rsquo;s I only did this on some of the DC&rsquo;s, and not all of them as I should.</p><h6 id="the-end-all-guide-to-repairing-active-directory-trust-relationships.wp-block-heading" class="ps-heading"><a href="https://adamtheautomator.com/trust-relationship-between-this-workstation-and-the-primary-domain-failed/?fbclid=IwAR1kl9nheqGadf0gk8z1TK8nfXmfaTWIeBQaXndnbIo1j3RdgIl4BQ6ThMA"><em>The End-All Guide to Repairing Active Directory Trust Relationships</em></a><a class="ps-heading-anchor" href="#the-end-all-guide-to-repairing-active-directory-trust-relationships.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Adam Bertram on 6th August</p><p>Once the most common problems that plagues Windows system administrators is trusted, Active Directory computers seemingly fall off the domain. In this guide, you&rsquo;re going to learn every trick I&rsquo;ve come across in my 20+ years managing Active Directory and how to automate it with PowerShell.</p><h6 id="modify-the-quick-launch-in-sharepoint-online-sites-using-powershell-pnp.wp-block-heading" class="ps-heading"><a href="https://veronicageek.com/office-365/sharepoint-online/modify-the-quick-launch-in-sharepoint-online-sites-using-powershell-pnp/2019/08/"><em>Modify the Quick Launch in SharePoint Online sites using PowerShell PnP</em></a><a class="ps-heading-anchor" href="#modify-the-quick-launch-in-sharepoint-online-sites-using-powershell-pnp.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Veronique Lengelle on 7th August</p><p>There are some useful cmdlets in the SharePoint PowerShell PnP module that one wouldn’t think about using, but coupled with a set of other cmdlets, they can be very useful!</p><h6 id="reddit-rpowershell---most-popular-weekly-post.wp-block-heading" class="ps-heading"><a href="https://www.reddit.com/r/PowerShell/comments/cmgs6o/reverse_engineering_powershell_malware/"><em>Reddit /r/PowerShell - Most Popular Weekly Post</em></a><a class="ps-heading-anchor" href="#reddit-rpowershell---most-popular-weekly-post.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>Reverse engineering powershell malware</p><h6 id="youtube-working-with-powershell-variables.wp-block-heading" class="ps-heading"><a href="https://www.youtube.com/watch?v=4Rc0aEMXiWw"><em>Youtube: Working With PowerShell Variables</em></a><a class="ps-heading-anchor" href="#youtube-working-with-powershell-variables.wp-block-heading" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>Learn how to use and work with PowerShell variables. See different PowerShell variable types, and how to identify them. Learn how to get a list of PowerShell constant and environment variables.</p>]]></content:encoded></item><item><title>ICYMI: PowerShell Week of 2-August-2019</title><link>https://powershell.org/articles/2019-08-02-icymi-powershell-week-of-2-august-2019/</link><guid>https://powershell.org/articles/2019-08-02-icymi-powershell-week-of-2-august-2019/</guid><pubDate>Fri, 02 Aug 2019 15:00:45 +0000</pubDate><description>&lt;p&gt;Topics include data aggregation, file permission migrations, checking reboots in the registry, credential management, default parameters and setting up for PowerShell Development.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Topics include data aggregation, file permission migrations, checking reboots in the registry, credential management, default parameters and setting up for PowerShell Development.</p><p>Special thanks to Prasoon Karunan V and Robin Dadswell</p><h6 id="aggregating-data-with-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#aggregating-data-with-powershell"/><a href="https://jesspomfret.com/powershell-aggregation/"><em>Aggregating Data with PowerShell</em></a><a class="ps-heading-anchor" href="#aggregating-data-with-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Jess Pomfret on July 26th</p><p>For DBAs aggregation of data is a given, but how do we do that in PowerShell? Find out with Jess&rsquo; look into ways to do it.</p><h6 id="transferring-file-permissions-with-powershell" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#transferring-file-permissions-with-powershell"/><a href="https://adamtheautomator.com/transfer-file-permissions/"><em>Transferring File Permissions with PowerShell</em></a><a class="ps-heading-anchor" href="#transferring-file-permissions-with-powershell" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Adam Bertram on July 26th</p><p>Maintaining file share permissions across servers can be a major challenge but by using PowerShell, we can automate this process allowing you to go home early.</p><h6 id="how-to-check-for-a-pending-reboot-in-the-registry-windows" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#how-to-check-for-a-pending-reboot-in-the-registry-windows"/><a href="https://adamtheautomator.com/pending-reboot-registry-windows/"><em>How to Check for a Pending Reboot in the Registry (Windows)</em></a><a class="ps-heading-anchor" href="#how-to-check-for-a-pending-reboot-in-the-registry-windows" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Adam Bertram on July 28th</p><p>Whenever you install software, updates or make configuration changes, it&rsquo;s common for Windows to need a reboot. Many OS tasks sometimes force Windows to require a reboot. When a reboot is pending, Windows add some registry values to show that. In this blog post, you&rsquo;re going to learn how to check for a pending reboot and how to build a PowerShell script to automate the task.</p><h6 id="credential-management-module" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#credential-management-module"/><a href="https://www.mosaicmk.com/2019/07/credential-management-module.html"><em>Credential Management Module</em></a><a class="ps-heading-anchor" href="#credential-management-module" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by MosaicMK Software on July 30th</p><p>Manage credentials saved to the windows credential manager and call them as clear text or a PSCredential object to be used by other PowerShell Commends</p><h6 id="whats-in-your-powershell-psdefaultparametervalues-preference-variable" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#whats-in-your-powershell-psdefaultparametervalues-preference-variable"/><a href="https://mikefrobbins.com/2019/08/01/whats-in-your-powershell-psdefaultparametervalues-preference-variable/"><em>What’s in your PowerShell $PSDefaultParameterValues Preference Variable?</em></a><a class="ps-heading-anchor" href="#whats-in-your-powershell-psdefaultparametervalues-preference-variable" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>by Mike F Robbins on August 1st</p><p>An view into Mike&rsquo;s use of a powerful preference variable added in PowerShell version 3.0.</p><h6 id="youtube-getting-setup-for-powershell-development" class="ps-heading wp-block-heading"><a href="https://github.com/devops-collective-inc/WhatYouMissedThisWeek/blob/master/20190802.MD#youtube-getting-setup-for-powershell-development"/><a href="https://www.youtube.com/watch?v=4-L7HwLgsf4"><em>Youtube: Getting setup for PowerShell Development</em></a><a class="ps-heading-anchor" href="#youtube-getting-setup-for-powershell-development" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h6><p>Learn how to configure and setup your computer for PowerShell Development. In this fourth episode of Learn PowerShell you learn to start coding PowerShell daily with a few free components and easy configuration. Follow along with this video for an easy step-by-step walk-through for getting setup to start writing PowerShell.</p>]]></content:encoded></item></channel></rss>