&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 2015 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2015/08/</link><description>Recent content in Articles from August 2015 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2015/08/index.xml" rel="self" type="application/rss+xml"/><item><title>List users logged on to your machines</title><link>https://powershell.org/articles/2015-08-28-list-users-logged-on-to-your-machines/</link><guid>https://powershell.org/articles/2015-08-28-list-users-logged-on-to-your-machines/</guid><pubDate>Fri, 28 Aug 2015 11:12:07 +0000</pubDate><description>&lt;p&gt;Password policies are the best 😀 Sometimes they lead to account logouts when someone forgets to logout of a session somewhere on the network though. It might be the TS session they use once a quarter for reporting or maybe you know the feeling when you RDP to a server only to find that it is locked by 2 other admins who forgot to logoff when they left. (Off cause this never happens… we all use PowerShell…) Anyway, this had me searching for a user session somewhere on the network. The worst thing is when my own password expires. I hate when my account ends up being locked. Therefor I made it a rule to just check all servers before I change password. There are multiple ways to do this but of course I tend to go the PowerShell route. &lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Password policies are the best 😀 Sometimes they lead to account logouts when someone forgets to logout of a session somewhere on the network though. It might be the TS session they use once a quarter for reporting or maybe you know the feeling when you RDP to a server only to find that it is locked by 2 other admins who forgot to logoff when they left. (Off cause this never happens… we all use PowerShell…) Anyway, this had me searching for a user session somewhere on the network. The worst thing is when my own password expires. I hate when my account ends up being locked. Therefor I made it a rule to just check all servers before I change password. There are multiple ways to do this but of course I tend to go the PowerShell route. </p><h2 id="research" class="ps-heading">Research<a class="ps-heading-anchor" href="#research" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The originally method I used is from<a href="https://gallery.technet.microsoft.com/scriptcenter/d46b1f3b-36a4-4a56-951b-e37815a2df0c">TechNet gallery</a></p><p>In short: Get-WmiObject -Class Win32_process</p><p>This basically finds all unique users running processes on the machine. This is cool because it finds everything even stuff running as a service but I&rsquo;m not convinced it is the most efficient way.</p><p>Checking up with google I find a lot of creative ways to check who is logged on to your box.</p><p><a href="http://www.peetersonline.nl/2008/11/oneliner-get-logged-on-users-with-powershell/">peetersonline.nl/2008/11/oneliner-get-logged-on-users-with-powershell/</a> gave me the idea to check Win32_LoggedOnUser which seems obvious.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-1.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-1.png" alt="2015-08-28 (1)"/></p><p>This looks great and seems to work with Get-CimInstance too though the output is a little different.</p><p><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28.png" alt="2015-08-28"/><p><a href="http://learn-powershell.net/2010/11/01/quick-hit-find-currently-logged-on-users/">learn-powershell.net/&hellip;/Quick-hit-find-currently-logged-on-users/</a> took a little more old-school approach which I kind of like because it&rsquo;s a little rough and forces me to play with my<a href="https://powershell.org/2015/08/12/template-based-parsing-and-progress-bars/">template based parsing.</a></p><p> <a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-2.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-2.png" alt="2015-08-28 (2)"/></p><p>I&rsquo;m not really sure which method is faster so why not try implementing all 3 in a module and test it out.</p><h2 id="sketching" class="ps-heading">Sketching<a class="ps-heading-anchor" href="#sketching" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>It&rsquo;s always a good idea to begin by making a sketch of what you&rsquo;re trying to accomplish.</p><p>`Pseudo code:
Get-ActiveUser -ComputerName [] -Method [Cim,Wmi,Query]
Wanted output:
Username ComputerName</p><hr><p>TestUser1 Svr3
TestUser3 Svr3
DonaldDuck Client2
`Now I have all the information I need to set up the GitHub repository.</p><p><a href="https://github.com/mrhvid/Get-ActiveUser">github.com/mrhvid/Get-ActiveUser</a></p><h2 id="code" class="ps-heading">Code<a class="ps-heading-anchor" href="#code" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>First of all the parameters I&rsquo;m interested in are ComputerName and Method.</p><p><code>Param ( # Computer name, IP, Hostname [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] [String[]] $ComputerName, # Choose method, WMI, CIM or Query [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=1)] [ValidateSet('WMI','CIM','Query')] [String] $Method )</code>I already have 3 possible Methods in mind so I set ValidateSet with the 3 possibilities. Then I don&rsquo;t have to worry about that input later.</p><p><code>Process { switch ($Method) { 'WMI' { } 'CIM' { } 'Query' { } } }</code>In the Process part of my function I simply use a switch for the 3 different methods I allowed in the Parameter.</p><p>Now it&rsquo;s basic fill-in-the-blanks.</p><h3 id="wmi" class="ps-heading">WMI<a class="ps-heading-anchor" href="#wmi" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>My old solution is simpel and works fine.</p><p><code>$WMI = Get-WmiObject -Class Win32_Process -ComputerName $ComputerName -ErrorAction Stop $ProcessUsers = $WMI.getowner().user | Select-Object -Unique</code><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-3.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-3.png" alt="2015-08-28 (3)"/></p><p>But now that I found Win32_LoggedOnUser it seams wrong to do it this way. Lets look at the new idea instead.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-4.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-4.png" alt="2015-08-28 (4)"/></p><p><a href="https://powershell.org/wp-content/uploads/2015/08/gwmi-Wmi32_LoggedOnUser_gm.png"><img src="https://powershell.org/wp-content/uploads/2015/08/gwmi-Wmi32_LoggedOnUser_gm.png" alt="gwmi-Wmi32_LoggedOnUser_gm"/></p><p>This is all the right data but it seems to be in a string format so I&rsquo;ll have to do a little manipulation. This can be done in a million ways.</p><p><code>function Get-MyLoggedOnUsers { param([string]$Computer) Get-WmiObject Win32_LoggedOnUser -ComputerName $Computer | Select Antecedent -Unique | %{“{0}{1}” -f $_.Antecedent.ToString().Split(‘”‘)[1], $_.Antecedent.ToString().Split(‘”‘)[3]} }</code>Peter&rsquo;s aforementioned one-liner didn&rsquo;t seem very reader-friendly to me, which is ok for a one-liner, but I would like it to be a little more readable if possible.</p><p><code>$WMI = (Get-WmiObject Win32_LoggedOnUser).Antecedent $ActiveUsers = @() foreach($User in $WMI) { $StartOfUsername = $User.LastIndexOf('=') + 2 $EndOfUsername = $User.Length - $User.LastIndexOf('=') -3 $ActiveUsers += $User.Substring($StartOfUsername,$EndOfUsername) }</code><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-5.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-5.png" alt="2015-08-28 (5)"/></p><p> This seams right 🙂 I&rsquo;ll save the output in $ActiveUsers variable and do the same for CIM and Query.</p><h3 id="cim" class="ps-heading">CIM<a class="ps-heading-anchor" href="#cim" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Lets try with CIM.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-6.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-6.png" alt="2015-08-28 (6)"/></p><p>This looks way more structured.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-7.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-28-7.png" alt="2015-08-28 (7)"/></p><p>CIM ends up being an easy to understand one-liner 😀</p><p><code>$ActiveUsers = (Get-CimInstance Win32_LoggedOnUser -ComputerName $ComputerName).antecedent.name | Select-Object -Unique</code>### Query</p><p>Using the good ol&rsquo; Query.exe I found the<a href="https://powershell.org/2015/08/12/template-based-parsing-and-progress-bars/">template based parsing discussed earlier</a> very useful.</p><p>`$Template = @'
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME</p><blockquote><p>{USER*:jonas} console 1 Active 1+00:27 24-08-2015 22:22
{USER*:test} 2 Disc 1+00:27 25-08-2015 08:26
&lsquo;@
$Query = query.exe user
$ActiveUsers = $Query | ConvertFrom-String -TemplateContent $Template | Select-Object -ExpandProperty User
`### Output</p></blockquote><p>Now I just need to format and output the users in a nice way. I want clean objects with ComputerName and UserName.</p><p>`# Create nice output format
$UsersComputersToOutput = @()
foreach($User in $ActiveUsers) {
$UsersComputersToOutput += New-Object psobject -Property @{
ComputerName=$ComputerName;
UserName=$User
}
}
}</p><h1 id="output-data" class="ps-heading">output data<a class="ps-heading-anchor" href="#output-data" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>$UsersComputersToOutput
`## Testing</p><p>Now I have a problem. I can&rsquo;t test this as I don&rsquo;t have a bunch of test serveres at my disposal. All my testing has been done against my own Windows 10 box. It&rsquo;s seems that query is a lot faster running locally but WMI/CIM might give a more complete view of what services are running.  </p><p><a href="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_wmi_highlight.png"><img src="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_wmi_highlight.png" alt="get-activeuser_wmi_highlight"/></p><p>I have a bunch of standard service accounts running that might be nice to remove from the output. Also for this to be useful we will want to run it against a lot of machines.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_query.png"><img src="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_query.png" alt="get-activeuser_query"/></p><p>Combining Get-ActiveUser with<a href="https://powershell.org/2015/08/20/multithreading-using-jobs/">Start-Multithread from last weeks post</a> seems to be working as intended.</p><p><code>Start-Multithread -Script { param($C) Get-ActiveUser -ComputerName $C -Method Query } -ComputerName ::1,Localhost | Out-GridView</code>Piping the above to Out-GridView is proberbly my personal favorite way of accomplishing something truly useful.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_query_out-gridview.png"><img src="https://powershell.org/wp-content/uploads/2015/08/get-activeuser_query_out-gridview.png" alt="get-activeuser_query_out-gridview"/></p><p>Now we have all the data in a nice searchable way and it&rsquo;s really easy to check if your user is logged in on some random machine. It also an easy way to check for rouge users on your network.</p><h2 id="publishing-and-feedback" class="ps-heading">Publishing and feedback<a class="ps-heading-anchor" href="#publishing-and-feedback" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The code is published on<a href="https://www.powershellgallery.com/packages/Get-ActiveUser/">PowerShellGallery</a>.</p><p>Please help me out by testing it for me. I would love to know if this works in the real world 🙂</p><p><code># To install Get-ActiveUser Install-Module Get-ActiveUser #To install Start-Multithread Install-Module Start-Multithread</code>This should work when you have WMF 5 + installed and on Windows 10 out of the box. </p><p>As this is my third blogpost ever I would love some feedback. Is there something I could do better or in a better format? Have you used this and for what? Please let me know in the comments 🙂</p><h4 id="contact-me" class="ps-heading">Contact me<a class="ps-heading-anchor" href="#contact-me" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Twitter<a href="https://twitter.com/mrhvid">@mrhvid</a><br>
Web<a href="http://Jonas.SommerNielsen.dk">Jonas.SommerNielsen.dk</a></p>
]]></content:encoded></item><item><title>TechSession Webinar: The Top 10 Considerations When Writing #PowerShell Advanced Functions</title><link>https://powershell.org/articles/2015-08-26-techsession-webinar-the-top-10-considerations-when-writing-powershell-advanced-functions/</link><guid>https://powershell.org/articles/2015-08-26-techsession-webinar-the-top-10-considerations-when-writing-powershell-advanced-functions/</guid><pubDate>Wed, 26 Aug 2015 14:52:40 +0000</pubDate><description>&lt;p&gt;On Wednesday, September 2nd at 2pm EDT (1pm CDT), I’ll be presenting the September TechSession Webinar for PowerShell.org. The topic for this month&amp;rsquo;s session is: “&lt;a href="https://powershell.org/event/techsession-the-top-10-considerations-when-writing-powershell-advanced-functions/"&gt;The Top 10 Considerations When Writing PowerShell Advanced Functions&lt;/a&gt;”.&lt;/p&gt;
&lt;p&gt;Here’s what you can expect from my presentation:&lt;/p&gt;
&lt;p&gt;There are lots of things to consider when writing an advanced function in PowerShell depending on what the function will be designed to accomplish, what operating system and PowerShell versions it will be written for, and who will be using it. During this session, PowerShell MVP Mike F Robbins will walk you through the top 10 items that he takes into consideration along with his thought process when creating advanced functions in PowerShell. We’ll briefly discuss comment based help, parameters, parameter validation, pipeline input, and error handling. This will NOT be a deep dive into any one of these topics as the focus of this session will be on writing advanced functions to maximize code reusability by minimizing static values. Prior experience with PowerShell is recommended.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>On Wednesday, September 2nd at 2pm EDT (1pm CDT), I’ll be presenting the September TechSession Webinar for PowerShell.org. The topic for this month&rsquo;s session is: “<a href="https://powershell.org/event/techsession-the-top-10-considerations-when-writing-powershell-advanced-functions/">The Top 10 Considerations When Writing PowerShell Advanced Functions</a>”.</p><p>Here’s what you can expect from my presentation:</p><p>There are lots of things to consider when writing an advanced function in PowerShell depending on what the function will be designed to accomplish, what operating system and PowerShell versions it will be written for, and who will be using it. During this session, PowerShell MVP Mike F Robbins will walk you through the top 10 items that he takes into consideration along with his thought process when creating advanced functions in PowerShell. We’ll briefly discuss comment based help, parameters, parameter validation, pipeline input, and error handling. This will NOT be a deep dive into any one of these topics as the focus of this session will be on writing advanced functions to maximize code reusability by minimizing static values. Prior experience with PowerShell is recommended.</p><p>Registration URL:<a href="https://attendee.gotowebinar.com/register/39900545688014338">https://attendee.gotowebinar.com/register/39900545688014338</a></p><p>Who am I?</p><p>Mike F Robbins is a Microsoft MVP on Windows PowerShell and a SAPIEN Technologies MVP. He is a co-author of Windows PowerShell TFM 4th Edition and is a contributing author of a chapter in the PowerShell Deep Dives book. Mike has written guest blog articles for the Hey, Scripting Guy! Blog, PowerShell Magazine, and PowerShell.org. He is the winner of the advanced category in the 2013 PowerShell Scripting Games. Mike is also the leader and co-founder of the<a href="http://mspsug.com/">Mississippi PowerShell User Group</a>. He blogs at<a href="http://mikefrobbins.com/">mikefrobbins.com</a> and can be found on twitter<a href="http://twitter.com/mikefrobbins">@mikefrobbins</a>.</p><p>µ</p>
]]></content:encoded></item><item><title>Multithreading using jobs</title><link>https://powershell.org/articles/2015-08-20-multithreading-using-jobs/</link><guid>https://powershell.org/articles/2015-08-20-multithreading-using-jobs/</guid><pubDate>Thu, 20 Aug 2015 10:23:48 +0000</pubDate><description>&lt;p&gt;Often I have had to check something against all servers or clients. A classic problem and every time I run into the it it&amp;rsquo;s time consuming and running the job multithreaded would be nice.&lt;/p&gt;
&lt;p&gt;A few years back I found a nice little script for multithreading which I have been using quite often. Unfortunately this wasn&amp;rsquo;t a module. And I can&amp;rsquo;t remember where it came from. So this week I set my mind on recreating this as a module and to see if I can publish it on &lt;a href="https://www.powershellgallery.com/"&gt;PowerShell Gallery&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Often I have had to check something against all servers or clients. A classic problem and every time I run into the it it&rsquo;s time consuming and running the job multithreaded would be nice.</p><p>A few years back I found a nice little script for multithreading which I have been using quite often. Unfortunately this wasn&rsquo;t a module. And I can&rsquo;t remember where it came from. So this week I set my mind on recreating this as a module and to see if I can publish it on<a href="https://www.powershellgallery.com/">PowerShell Gallery</a>.</p><h2 id="version-control-101" class="ps-heading"><strong>Version control 101</strong><a class="ps-heading-anchor" href="#version-control-101" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I recently watched the<a href="https://www.youtube.com/watch?v=wmPfDbsPeZY">crash course</a> Warren did on youtube a month back and I started out creating a repository for the project.</p><p><a href="https://github.com/mrhvid/Start-MultiThread">github.com/mrhvid/Start-MultiThread</a></p><p>I will let the video explain the concept. But I already feel more productive and safe while coding. Only thing left is to get in a process where I commit often or at least when it makes sense.</p><h2 id="idea" class="ps-heading"><strong>Idea</strong><a class="ps-heading-anchor" href="#idea" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The original version was just a function I found on google somewhere. It worked fine but it wasn&rsquo;t too handy to load up each time. And the input for the function was for two files, a script and a text file with a list of ComputerNames.</p><p>It would be nice if I could just call it with a list of computer names from whereever. e.g. Get-ADComputer, (Computer1, Computer2, localhost) or (Get-content servers.txt).b</p><p>And for quick oneliners if I need something simple it would be nice to be able to just write the script and not have to save a .ps1 file with the command.</p><p><strong>Pseudo code</strong>:</p><p><code>Multi-Thread -Script { Test-Connection } -Computers [list of computers]</code>## Execution</p><p>First off I needed to figure out a good name.</p><p>Get-Verb lists 98 verbs on my machine. Sadly &ldquo;multi&rdquo; is not one of them. After som consideration I chose<strong>&ldquo;Start&rdquo;</strong> as a good verb, and<strong>&ldquo;multithread&rdquo;</strong> as the noun.</p><p><code>Start-MultiThread</code>Sounds fair so I created a new folder with this name and a Start-MultiThread.psm1 file for the module.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/Snippit.png"><img src="https://powershell.org/wp-content/uploads/2015/08/Snippit.png" alt="Snip"/></p><p>A snippet for a full advanced function is always a good starting point. I added this to my version control and things are looking good so far.</p><p><a href="https://github.com/mrhvid/Start-Multithread/commit/9355446aae85c9f23abe07481edc3ec84d487fe4">https://github.com/mrhvid/Start-Multithread/&hellip;</a> (first upload)</p><p>It already looks way more organized than what I usually come up with.</p><h3 id="coding" class="ps-heading">Coding<a class="ps-heading-anchor" href="#coding" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Tuesday afternoon I put on my headphones, started banging away on my keyboard and the result was this code</p><p><code>function Start-Multithread { [CmdletBinding(DefaultParameterSetName='Parameter Set 1', SupportsShouldProcess=$true, PositionalBinding=$false, HelpUri = 'https://github.com/mrhvid/Start-MultiThread/', ConfirmImpact='Medium')] [Alias()] [OutputType([String])] Param ( # Command or script to run. Must take ComputerName as argument to make sense. [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $Script, # List of computers to run script against [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=1)] [String[]] $Computers, # Maximum concurrent threads to start [Parameter(Mandatory=$false, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=2)] [int] $MaxThreads = 20 , # Number of sec to wait after last thred is started. [Parameter(Mandatory=$false, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=3)] [int] $MaxWaitTime = 600, # Number of Milliseconds to wait if MaxThreads is reached [Parameter(Mandatory=$false, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=4)] $SleepTime = 500 ) Begin { } Process { if ($pscmdlet.ShouldProcess('Target', 'Operation')) { $i = 0 $Jobs = @() Foreach($Computer in $Computers) { # Wait for running jobs to finnish if MaxThreads is reached While((Get-Job -State Running).count -gt $MaxThreads) { Write-Progress -Id 1 -Activity 'Waiting for existing jobs to complete' -Status "$($(Get-job -State Running).count) jobs running" -PercentComplete ($i / $Computers.Count * 100) Start-Sleep -Milliseconds $SleepTime } # Start new jobs $i++ $Jobs += Start-Job -ScriptBlock $Script -ArgumentList $Computer -Name $Computer -OutVariable LastJob Write-Progress -Id 1 -Activity 'Starting jobs' -Status "$($(Get-job -State Running).count) jobs running" -PercentComplete ($i / $Computers.Count * 100) } # All jobs have now been started # Wait for jobs to finish While((Get-Job -State Running).count -gt 0) { $JobsStillRunning = '' foreach($RunningJob in (Get-Job -State Running)) { $JobsStillRunning += $RunningJob.Name } Write-Progress -Id 1 -Activity 'Waiting for jobs to finish' -Status "$JobsStillRunning" -PercentComplete (($Computers.Count - (Get-Job -State Running).Count) / $Computers.Count * 100) Start-Sleep -Milliseconds $SleepTime } # Output Get-job | Receive-Job # Cleanup Get-job | Remove-Job } } End { } }</code>This is by no means final code. (I already made small changes check<a href="https://github.com/mrhvid/Start-Multithread">GitHub</a> for latest code). But the outline started to look good.</p><p>The Foreach just runs through the list of computers supplied and for each one starts a new job with the script code and the ComputerName as argument.  </p><p>To make sure the throttle limit is kept I have a small While loop that checks the number of running jobs and just sleeps until it falls under $MaxThreads limit.</p><p>When all jobs are started it&rsquo;s just a matter of waiting for all jobs to finish. (It would be wise to add a timer here and kill hanging jobs after some time)</p><p>And lastly I just output all the results.</p><h3 id="testing" class="ps-heading">Testing<a class="ps-heading-anchor" href="#testing" 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://powershell.org/wp-content/uploads/2015/08/2015-08-19-6.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-6.png" alt="2015-08-19 (6)"/></p><p> This looks great but unfortunately it fails to receive the computername.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-7.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-7.png" alt="2015-08-19 (7)"/></p><p>It does run the code once for each computer but it asks for a computername each time which kind of defeats the point.</p><p>Good thing we have google and good ol&rsquo;<a href="https://powershell.org/forums/topic/passing-parameter-to-start-job/">Don</a>.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-8.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-8.png" alt="2015-08-19 (8)"/></p><p>Adding a parameter() block to the script makes it work.</p><p>Clearly there&rsquo;s still a lot to be done here.</p><h3 id="publishing" class="ps-heading">Publishing<a class="ps-heading-anchor" href="#publishing" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>But creating modules is only really fun if you can share them with others. And this is where I&rsquo;m beginning to love PowerShell v5. It turns out it&rsquo;s quite simpel to do this.</p><p><a href="https://www.powershellgallery.com/packages/upload">PowerShellGallery.com</a> describes this. After signing up it&rsquo;s a one-liner.</p><p><code>PS&gt; Publish-Module -Name -NuGetApiKey</code>You need to create a manifest for your module first.</p><p>Now I have my module published and it has it&rsquo;s own page on the internet WUUHU</p><p><a href="https://www.powershellgallery.com/packages/Start-Multithread/">www.powershellgallery.com/packages/Start-Multithread</a></p><p>Cool as that might seem the really cool stuff comes next.</p><h3 id="installing-on-a-new-machine" class="ps-heading">Installing on a new machine<a class="ps-heading-anchor" href="#installing-on-a-new-machine" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>This requires WMF 5 or newer. Aka. Windows 10 works out of the box. Try it out from your elevated powershell promt.</p><p><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-9.png" alt="2015-08-19 (9)"/><p>The module is available from the standard PSGallery repository. And installing it on your machine is as simpel as piping this to Install-Module</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-10.png"><img src="https://powershell.org/wp-content/uploads/2015/08/2015-08-19-10.png" alt="2015-08-19 (10)"/></p><p>Now you can try out the module on your own machine. Promission to be impressed. </p><h2 id="help-make-it-better" class="ps-heading">Help make it better<a class="ps-heading-anchor" href="#help-make-it-better" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>This module is not flawless so if you have any ideas feel free to get on your<a href="https://github.com/mrhvid/Start-Multithread">GitHub</a> and submit changes 🙂</p><p>My idea is to keep it simple and try to follow some good practices e.g. as described in<a href="http://www.manning.com/jones4/">Learn PowerShell Toolmaking in a Month of Lunches</a>.</p><h4 id="contact-me" class="ps-heading">Contact me<a class="ps-heading-anchor" href="#contact-me" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Twitter<a href="https://twitter.com/mrhvid">@mrhvid</a><br>
Web<a href="http://Jonas.SommerNielsen.dk">Jonas.SommerNielsen.dk</a></p>
]]></content:encoded></item><item><title>Philadelphia PowerShell User Group Meeting – September 3rd 2015 with Max Trinidad</title><link>https://powershell.org/articles/2015-08-17-philadelphia-powershell-user-group-meeting-september-3rd-2015-with-max-trinidad/</link><guid>https://powershell.org/articles/2015-08-17-philadelphia-powershell-user-group-meeting-september-3rd-2015-with-max-trinidad/</guid><pubDate>Tue, 18 Aug 2015 01:11:05 +0000</pubDate><description>&lt;p&gt;Join us on Thursday, September 3rd when &lt;a href="https://twitter.com/juneb_get_help"&gt;
Maximo Trinidad
&lt;/a&gt; will be giving a talk called a &amp;ldquo;&lt;strong&gt;Creating a SQL Server Database Report with PowerShell&lt;/strong&gt;&amp;rdquo;. As describe by Maximo: This is a deep dive on how to create a SQL Server report using PowerShell and SMO. At the same time, you will learn how to create and work with PowerShell objects, scriptblocks, formatting properties, and generating output results. We&amp;rsquo;ll be looking into creating a report to identify database properties irregularities. This will be a good start to help begin documenting your SQL Server on the network.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Join us on Thursday, September 3rd when<a href="https://twitter.com/juneb_get_help">
Maximo Trinidad</a> will be giving a talk called a &ldquo;<strong>Creating a SQL Server Database Report with PowerShell</strong>&rdquo;. As describe by Maximo: This is a deep dive on how to create a SQL Server report using PowerShell and SMO. At the same time, you will learn how to create and work with PowerShell objects, scriptblocks, formatting properties, and generating output results. We&rsquo;ll be looking into creating a report to identify database properties irregularities. This will be a good start to help begin documenting your SQL Server on the network.</p><p><strong>About Maximo Trinidad</strong></p><p>Maximo Trinidad (Florida Aka – Mr. PowerShell) hails from Puerto Rico and have been working with computers since 1979. Throughout his many years, he has worked with SQL Server Technologies, and provided support to Windows Servers/Client Systems, Microsoft Cloud and Virtualization Technologies. Maximo has also been a Microsoft PowerShell MVP since 2009 and MVP SAPIEN Technologies 2015.  You can find him speaking in most at most of the SQLSaturday, IT Pro and .NET camps events around the Florida’s State.  He is also the founder of the Florida PowerShell User Group which meets every 3rd Thursday evening of the month.
Follow him on<a href="https://twitter.com/MaxTrinidad">
Twitter</a> and on his<a href="http://www.maxtblog.com/">
blog</a>!</p><p>Please <a href="https://www.eventbrite.com/e/phillyposh-september-3rd-2015-max-trinidad-tickets-18198473123">
register</a> if you plan to attend in person or online.<strong>PLEAE NOTE THE NEW LOCATION!</strong> The meeting URL to join us remotely will be included in your Eventbrite registration confirmation.</p><p><a href="http://www.eventbrite.com/e/phillyposh-september-3rd-2015-max-trinidad-tickets-18198473123?ref=ebtnebregn"><img src="https://www.eventbrite.com/custombutton?eid=18198473123" alt="Eventbrite - PhillyPosh September 3rd 2015 - Max Trinidad"/></p>
]]></content:encoded></item><item><title>TEST IT: New IISAdministration Module</title><link>https://powershell.org/articles/2015-08-17-test-it-new-iisadministration-module/</link><guid>https://powershell.org/articles/2015-08-17-test-it-new-iisadministration-module/</guid><pubDate>Mon, 17 Aug 2015 17:35:08 +0000</pubDate><description>&lt;p&gt;It&amp;rsquo;s no secret that Microsoft&amp;rsquo;s WebAdministration module isn&amp;rsquo;t universally loved. It&amp;rsquo;s functionality isn&amp;rsquo;t deep, and it doesn&amp;rsquo;t play well in the PowerShell pipeline. There are also a number of things in it that run really slowly, making bulk administration a pain.&lt;/p&gt;
&lt;p&gt;Last week, &lt;a href="http://blogs.iis.net/bariscaglar/iisadministration-powershell-cmdlets-new-feature-in-windows-10-server-2016"&gt;Baris Caglar announced that Windows 10 contains a new IISAdministration module&lt;/a&gt;, which is a rough draft of what is hoped to be a final module in Windows Server 2016. &lt;strong&gt;If you use IIS, get hold of this and start testing so the team can get feedback.&lt;/strong&gt; Note that this is a _feature of Windows 10; _I haven&amp;rsquo;t yet been able to test and see if file-copying it to another version of Windows will work or not (if you try, please post your results in a comment). The module seems to rely heavily on the &lt;a href="https://msdn.microsoft.com/en-us/library/microsoft.web.administration.servermanager(v=vs.90).aspx"&gt;IIS Administration .NET class&lt;/a&gt;, going so far as giving you easy access to an instance of it so you can code against it directly for whatever the module itself doesn&amp;rsquo;t offer.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>It&rsquo;s no secret that Microsoft&rsquo;s WebAdministration module isn&rsquo;t universally loved. It&rsquo;s functionality isn&rsquo;t deep, and it doesn&rsquo;t play well in the PowerShell pipeline. There are also a number of things in it that run really slowly, making bulk administration a pain.</p><p>Last week,<a href="http://blogs.iis.net/bariscaglar/iisadministration-powershell-cmdlets-new-feature-in-windows-10-server-2016">Baris Caglar announced that Windows 10 contains a new IISAdministration module</a>, which is a rough draft of what is hoped to be a final module in Windows Server 2016. <strong>If you use IIS, get hold of this and start testing so the team can get feedback.</strong> Note that this is a _feature of Windows 10; _I haven&rsquo;t yet been able to test and see if file-copying it to another version of Windows will work or not (if you try, please post your results in a comment). The module seems to rely heavily on the<a href="https://msdn.microsoft.com/en-us/library/microsoft.web.administration.servermanager(v=vs.90).aspx">IIS Administration .NET class</a>, going so far as giving you easy access to an instance of it so you can code against it directly for whatever the module itself doesn&rsquo;t offer.</p><p>IIS as a product is in a weird place, because it no longer has a dedicated sub-team within the Windows Server team (at least, it didn&rsquo;t last I checked). That&rsquo;s made it difficult for anyone at Microsoft to produce a better administration module, since nobody really &ldquo;owned&rdquo; the product as their daily job, and nobody was available to be tasked with PowerShell improvements. Hopefully this new module is a step in the right direction at last.</p><p>Some of what we still don&rsquo;t know:</p><ul><li>Will this be released under an open-source license, perhaps posted on GitHub where others can contribute?</li><li>Is the Win2016 release a for-sure on finalizing this module, or is that more a target? How will subsequent releases be made available?</li><li>Can this be made available for downlevel operating systems? The .NET class in question has been around since IIS7, so it seems in theory that the code would run on older versions of Windows.</li></ul><p>Unfortunately, because Microsoft&rsquo;s IIS.NET blog system doesn&rsquo;t seem to do well with handling spam 😉 I&rsquo;m not sure asking the author there will produce any answers - but let&rsquo;s try!</p>
]]></content:encoded></item><item><title>Abstraction and Configuration Data</title><link>https://powershell.org/articles/2015-08-16-abstraction-and-configuration-data/</link><guid>https://powershell.org/articles/2015-08-16-abstraction-and-configuration-data/</guid><pubDate>Sun, 16 Aug 2015 20:55:20 +0000</pubDate><description>&lt;p&gt;Modularity and abstraction are a huge benefit in scripting and coding. Which of the following blocks of code are easier to understand?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$SQLConnection = New-Object System.Data.SqlClient.SQLConnection $SQLConnection.ConnectionString = 'Server=SqlServer1;Database=MyDB;Integrated Security=True;Connect Timeout=15' $cmd = New-Object system.Data.SqlClient.SqlCommand(&amp;quot;SELECT * FROM Table1&amp;quot;,$SQLConnection) $ds = New-Object system.Data.DataSet $da = New-Object system.Data.SqlClient.SqlDataAdapter($cmd) [void]$da.fill($ds) $SQLConnection.Close() $ds.Tables[0] &lt;/code&gt;Or&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# Invoke-Sqlcmd2 -ServerInstance SQLServer1 -Database MyDB -Query 'SELECT * FROM Table1' &lt;/code&gt;If you aren&amp;rsquo;t a masochist, &lt;a href="https://raw.githubusercontent.com/RamblingCookieMonster/PowerShell/master/Invoke-Sqlcmd2.ps1"&gt;the latter&lt;/a&gt; probably looks a bit nicer. Oh, and it offers other parameters, error handling, parameterized SQL queries, built in help, and other benefits the .NET code block misses.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Modularity and abstraction are a huge benefit in scripting and coding. Which of the following blocks of code are easier to understand?</p><p><code>$SQLConnection = New-Object System.Data.SqlClient.SQLConnection $SQLConnection.ConnectionString = 'Server=SqlServer1;Database=MyDB;Integrated Security=True;Connect Timeout=15' $cmd = New-Object system.Data.SqlClient.SqlCommand("SELECT * FROM Table1",$SQLConnection) $ds = New-Object system.Data.DataSet $da = New-Object system.Data.SqlClient.SqlDataAdapter($cmd) [void]$da.fill($ds) $SQLConnection.Close() $ds.Tables[0]</code>Or&hellip;</p><p><code># Invoke-Sqlcmd2 -ServerInstance SQLServer1 -Database MyDB -Query 'SELECT * FROM Table1'</code>If you aren&rsquo;t a masochist,<a href="https://raw.githubusercontent.com/RamblingCookieMonster/PowerShell/master/Invoke-Sqlcmd2.ps1">the latter</a> probably looks a bit nicer. Oh, and it offers other parameters, error handling, parameterized SQL queries, built in help, and other benefits the .NET code block misses.</p><p>The takeaway? You should be writing or using Advanced Functions and Modules, not monolithic scripts and snippets. Do it for yourself. Do it for anyone who might have to read your code down the line.</p><p>Some modules can benefit from persistent configurations. If you have a module that wraps a REST API, you might want to allow the end user to specify a default URL, rather than specify it every time they run a command.</p><p>This begs the question: what data format should you use? XML? JSON? YAML? INI?</p><p><a href="http://ramblingcookiemonster.github.io/PowerShell-Configuration-Data/">This is a quick hit on options for storing configuration data in PowerShell</a>.</p><p>Don&rsquo;t be ashamed. Many of us sysadmins pride ourselves on learning through experience. That doesn&rsquo;t mean you need to re-invent all the wheels. It can be a great learning experience to write your own code and functions, but at the end of the day, there&rsquo;s nothing wrong with finding the best tool for the job, and sticking with it. Developers make a living writing code, yet they all borrow existing libraries.</p><p>Once you start writing modules and advanced functions, be sure to<a href="http://stevenmurawski.com/powershell/2015/8/moving-in-to-open-source">share them with the community</a>!</p>
]]></content:encoded></item><item><title>Template based parsing and progress bars</title><link>https://powershell.org/articles/2015-08-12-template-based-parsing-and-progress-bars/</link><guid>https://powershell.org/articles/2015-08-12-template-based-parsing-and-progress-bars/</guid><pubDate>Wed, 12 Aug 2015 22:54:37 +0000</pubDate><description>&lt;p&gt;Working with wifi I have often needed to do a survey of the surroundings, and therefor I loved that windows 7 (maybe even Vista) introduced more advanced netsh with wifi support.&lt;/p&gt;
&lt;p&gt;There’s a lot of useful information but it might be nice to have a more graphical overview. The thing is that a text blob like this is not very handy to work with.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://powershell.org/wp-content/uploads/2015/08/image1.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2015/08/image1.png" alt="image1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some time late last year I heard a guy from the powershell team on the Powerscripting podcast talk about ConvertFrom-String and the new template based parsing. And it occurred to me that you can combine this with a simple powershell progress bar (write-progress) to give a visual representation of signal strength.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Working with wifi I have often needed to do a survey of the surroundings, and therefor I loved that windows 7 (maybe even Vista) introduced more advanced netsh with wifi support.</p><p>There’s a lot of useful information but it might be nice to have a more graphical overview. The thing is that a text blob like this is not very handy to work with.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/image1.png"><img src="https://powershell.org/wp-content/uploads/2015/08/image1.png" alt="image1"/></p><p>Some time late last year I heard a guy from the powershell team on the Powerscripting podcast talk about ConvertFrom-String and the new template based parsing. And it occurred to me that you can combine this with a simple powershell progress bar (write-progress) to give a visual representation of signal strength.</p><p><strong>Why not try it out</strong></p><p>Ps&gt; help ConvertFrom-String -<a href="https://technet.microsoft.com/library/dn807178(v=wps.640).aspx">online</a></p><p><a href="https://powershell.org/wp-content/uploads/2015/08/Help_ConvertFrom-String.png"><img src="https://powershell.org/wp-content/uploads/2015/08/Help_ConvertFrom-String.png" alt="Help_ConvertFrom-String"/></p><p>This looks straight forward.</p><p><code>$TemplateSSID = @' Interface name : Wi-Fi There are 9 networks currently visible. SSID 1 : {SSID*:My Movies 5G} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP BSSID 1 : bc:ae:c5:eb:59:8c Signal : {SIGNAL:88}% Radio type : 802.11n Channel : 36 Basic rates (Mbps) : 6 12 24 Other rates (Mbps) : 9 18 36 48 54 SSID 3 : {SSID*:blackbox} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP BSSID 1 : c8:be:19:aa:98:a4 Signal : {SIGNAL:41}% Radio type : 802.11n Channel : 2 Basic rates (Mbps) : 1 2 5.5 11 Other rates (Mbps) : 6 9 12 18 24 36 48 54 SSID 4 : {SSID*:Greenbox} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP BSSID 1 : 20:c9:d0:28:fb:05 Signal : {SIGNAL:60}% Radio type : 802.11n Channel : 1 Basic rates (Mbps) : 1 2 5.5 11 Other rates (Mbps) : 6 9 12 18 24 36 48 54 BSSID 2 : 20:c9:d0:28:fb:06 Signal : 40% Radio type : 802.11n Channel : 100 Basic rates (Mbps) : 6 12 24 Other rates (Mbps) : 9 18 36 48 54 '@ $Netsh = netsh.exe wlan show networks mode=bssid $Netsh | ConvertFrom-String -TemplateContent $TemplateSSID</code>Executing the the above code resulted in</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/testoutput1.png"><img src="https://powershell.org/wp-content/uploads/2015/08/testoutput1.png" alt="testoutput1"/></p><p>This looks great. The data is structured nicely in a easy to use form.</p><p>Now lets combine that with a progress bar. We need a while loop to keep the progress bar alive and a one second sleep timer is probably a good idea.</p><p><code>while ($true) { $Netsh = netsh.exe wlan show networks mode=bssid $Networks = $Netsh | ConvertFrom-String -TemplateContent $TemplateSSID $i = 0 foreach($Network in $Networks) { Write-Progress -Id $i -Activity $Network.SSID -PercentComplete $Network.SIGNAL $i++ } Start-Sleep -Seconds 1 }</code>The essential part is just a foreach looping through the networks objects. We use Write-Progress with parameters SIGNAL strength as PercentComplete and SSSID as Activity.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/image3.png"><img src="https://powershell.org/wp-content/uploads/2015/08/image3.png" alt="ise progress bars"/></p><p>It looks great in ISE and even works in the shell</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/image4.png"><img src="https://powershell.org/wp-content/uploads/2015/08/image4.png" alt="shell progress"/></p><p>How cool is that?</p><p>The bright reader might have spotted an obvious flaw in the first template. It doesn’t handle networks with multiple radios e.g. a network with both a 2.4 ghz and 5 ghz and same ssid. And all the other nice information from netsh is simply ignored.</p><p><strong>Second try</strong></p><p><code>$TemplateSSID = @' Interface name : Wi-Fi There are 9 networks currently visible. {NETWORK*:SSID 1 : {SSID:My Movies 5G} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP {BSSID*:BSSID 1 : {MAC:bc:ae:c5:eb:59:8c} Signal : {SIGNAL:88}% Radio type : 802.11n Channel : {CHANNEL:36} Basic rates (Mbps) : 6 12 24 Other rates (Mbps) : 9 18 36 48 54}} {NETWORK*:SSID 3 : {SSID:blackbox} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP {BSSID*:BSSID 1 : {MAC:c8:be:19:aa:98:a4} Signal : {SIGNAL:41}% Radio type : 802.11n Channel : {CHANNEL:2} Basic rates (Mbps) : 1 2 5.5 11 Other rates (Mbps) : 6 9 12 18 24 36 48 54}} {NETWORK*:SSID 4 : {SSID:Greenbox} Network type : Infrastructure Authentication : WPA2-Personal Encryption : CCMP {BSSID*:BSSID 1 : {MAC:20:c9:d0:28:fb:05} Signal : {SIGNAL:60}% Radio type : 802.11n Channel : {CHANNEL:1} Basic rates (Mbps) : 1 2 5.5 11 Other rates (Mbps) : 6 9 12 18 24 36 48 54} {BSSID*:BSSID 2 : {MAC:20:c9:d0:28:fb:06} Signal : {SIGNAL:40}% Radio type : 802.11n Channel : {CHANNEL:100} Basic rates (Mbps) : 6 12 24 Other rates (Mbps) : 9 18 36 48 54}} '@ $Netsh = netsh.exe wlan show networks mode=bssid $Networks = $Netsh | ConvertFrom-String -TemplateContent $TemplateSSID $Networks</code>There&rsquo;s a bit more markup here, and I admit it took me a few tries to get my head around the nested data structure. Look more closely at SSID 4 above, and how this have 2 BSSID&rsquo;s, because of this they are marked with a *.</p><p>Now $Networks contain a little more complicated data structure</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/testoutput2.png"><img src="https://powershell.org/wp-content/uploads/2015/08/testoutput2.png" alt="testoutput2"/></p><p>Though if we dive into it                             </p><p><a href="https://powershell.org/wp-content/uploads/2015/08/testoutput3.png"><img src="https://powershell.org/wp-content/uploads/2015/08/testoutput3.png" alt="testoutput3"/></p><p>It does look more like what we saw first. But with more info. And we can even dig into TDC-TC network and see each channel.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/testoutput4.png"><img src="https://powershell.org/wp-content/uploads/2015/08/testoutput4.png" alt="testoutput4"/></p><p>A slightly modified loop</p><p><code>while ($true) { $Netsh = netsh.exe wlan show networks mode=bssid $Networks = $Netsh | ConvertFrom-String -TemplateContent $TemplateSSID $i = 0 foreach($Network in $Networks) { Write-Progress -Id $i -Activity $Network.network.SSID $i++ } Start-Sleep -Seconds 1 }</code>And the percentage complete is a sub object. So we will need another loop to go through every BSSID attached to the SSID</p><p><code>while ($true) { $Netsh = netsh.exe wlan show networks mode=bssid $Networks = $Netsh | ConvertFrom-String -TemplateContent $TemplateSSID $i = 0 foreach($Network in $Networks) { foreach($bssid in $Network.NETWORK.bssid) { Write-Progress -id $i -Activity $Network.network.SSID -Status "Channel: $($bssid.CHANNEL) MAC: $($bssid.MAC)" -PercentComplete $bssid.SIGNAL $i++ } } Start-Sleep -Seconds 1 }</code>The main thing here is of course using the template based parsing. It took me a few tries to figure it out, but it’s cool when it works and might be very useful in many other situations. The progress is just a hack that makes the presentation a little more fun.</p><p><strong>References</strong></p><ul><li><a href="http://www.lazywinadmin.com/2014/09/powershell-convertfrom-string-and.html">http://www.lazywinadmin.com/2014/09/powershell-convertfrom-string-and.html</a></li><li><a href="http://www.powershellmagazine.com/2014/09/09/using-the-convertfrom-string-cmdlet-to-parse-structured-text/">http://www.powershellmagazine.com/2014/09/09/using-the-convertfrom-string-cmdlet-to-parse-structured-text/</a></li><li><a href="http://blogs.msdn.com/b/powershell/archive/2014/10/31/convertfrom-string-example-based-text-parsing.aspx">http://blogs.msdn.com/b/powershell/archive/2014/10/31/convertfrom-string-example-based-text-parsing.aspx</a></li></ul><h4 id="contact-me" class="ps-heading">Contact me<a class="ps-heading-anchor" href="#contact-me" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Twitter<a href="https://twitter.com/mrhvid">@mrhvid</a><br>
Web<a href="http://Jonas.SommerNielsen.dk">Jonas.SommerNielsen.dk</a></p>
]]></content:encoded></item><item><title>The Start Sharing Challenge</title><link>https://powershell.org/articles/2015-08-10-the-start-sharing-challenge/</link><guid>https://powershell.org/articles/2015-08-10-the-start-sharing-challenge/</guid><pubDate>Mon, 10 Aug 2015 15:55:25 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m back from &lt;a href="https://techmentorevents.com/Home.aspx"&gt;Techmentor Redmond 2015&lt;/a&gt; which was my first public speaking talk ever. It went great. I met a ton of great people and really enjoyed myself. When speaking to IT pros one of the questions I typically ask them is &amp;ldquo;&lt;strong&gt;Are you blogging or sharing your knowledge?&lt;/strong&gt;&amp;rdquo;. 9 times out of 10 I get a big, fat no. Why? It&amp;rsquo;s because they feel like they have nothing to share. They feel like no one would be interested in their ho-hum, mundane life as an IT guy. I always followup that comment with &amp;ldquo;How do you know?&amp;rdquo; which ultimately results in a shrug. You don&amp;rsquo;t know that your life isn&amp;rsquo;t interesting and can teach others something. &lt;strong&gt;Why are you making the decision for others?&lt;/strong&gt; You&amp;rsquo;ve acquired lots of knowledge in your career. Don&amp;rsquo;t be stingy! Share it!&lt;br&gt;
As a personal challenge to you, I have a copy of Don Jones&amp;rsquo; and Jeff Hicks&amp;rsquo; &lt;a href="http://www.manning.com/jones4/"&gt;Learn PowerShell Toolmaking in a Month of Lunches&lt;/a&gt; book. If you don&amp;rsquo;t have a blog today, start one. If you do and haven&amp;rsquo;t blogged in awhile, dust it off and start writing again. The first one to contact me on my blog &lt;a href="http://adamtheautomator.com"&gt;Adam, The Automator&lt;/a&gt; with a link to their blog with at least 5 good posts will win the book. Don&amp;rsquo;t try to sneak those piddly little one paragraph posts by me just to get a free book! Minimum post length is 500 words.&lt;br&gt;
You have nothing to lose but perhaps a few hours of your time and some further opportunities in your career. Give back and you will be rewarded.&lt;br&gt;
P.S. Did you know I used to blog about selling used books on Amazon? Talk about a niche topic. At it&amp;rsquo;s peak it was getting over 1,000 readers/day. Now, don&amp;rsquo;t you think IT is just a wee bit bigger than that? If I can blog about selling used books and get 1,000 readers/day you can spend just an hour a week writing a blog post about your IT experiences and you &lt;em&gt;will&lt;/em&gt; help more people than you think.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m back from<a href="https://techmentorevents.com/Home.aspx">Techmentor Redmond 2015</a> which was my first public speaking talk ever. It went great. I met a ton of great people and really enjoyed myself. When speaking to IT pros one of the questions I typically ask them is &ldquo;<strong>Are you blogging or sharing your knowledge?</strong>&rdquo;. 9 times out of 10 I get a big, fat no. Why? It&rsquo;s because they feel like they have nothing to share. They feel like no one would be interested in their ho-hum, mundane life as an IT guy. I always followup that comment with &ldquo;How do you know?&rdquo; which ultimately results in a shrug. You don&rsquo;t know that your life isn&rsquo;t interesting and can teach others something.<strong>Why are you making the decision for others?</strong> You&rsquo;ve acquired lots of knowledge in your career. Don&rsquo;t be stingy! Share it!<br>
As a personal challenge to you, I have a copy of Don Jones&rsquo; and Jeff Hicks&rsquo;<a href="http://www.manning.com/jones4/">Learn PowerShell Toolmaking in a Month of Lunches</a> book. If you don&rsquo;t have a blog today, start one. If you do and haven&rsquo;t blogged in awhile, dust it off and start writing again. The first one to contact me on my blog<a href="http://adamtheautomator.com">Adam, The Automator</a> with a link to their blog with at least 5 good posts will win the book. Don&rsquo;t try to sneak those piddly little one paragraph posts by me just to get a free book! Minimum post length is 500 words.<br>
You have nothing to lose but perhaps a few hours of your time and some further opportunities in your career. Give back and you will be rewarded.<br>
P.S. Did you know I used to blog about selling used books on Amazon? Talk about a niche topic. At it&rsquo;s peak it was getting over 1,000 readers/day. Now, don&rsquo;t you think IT is just a wee bit bigger than that? If I can blog about selling used books and get 1,000 readers/day you can spend just an hour a week writing a blog post about your IT experiences and you<em>will</em> help more people than you think.</p>
]]></content:encoded></item><item><title>Continuous Integration, Continuous Delivery, and PSDeploy</title><link>https://powershell.org/articles/2015-08-08-continuous-integration-continuous-delivery-and-psdeploy/</link><guid>https://powershell.org/articles/2015-08-08-continuous-integration-continuous-delivery-and-psdeploy/</guid><pubDate>Sat, 08 Aug 2015 15:16:01 +0000</pubDate><description>&lt;p&gt;Are you starting to use version control at work? Are you being pestered by fellow PowerShell aficionados to start learning version control? Did you catch the PowerShell.org &lt;a href="https://powershell.org/event/techsession-a-crash-course-in-version-control-and-git/"&gt;Crash Course in Version Control&lt;/a&gt; and pick up some Git and GitHub experience? Shameless plug, sorry : )&lt;/p&gt;
&lt;p&gt;Version control is just the start. What if we want to automate testing? To deploy our files, folders, and other artifacts out to production or other environments? Version control alone offers some nice benefits, but without these extra steps, it might introduce some pain points!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Are you starting to use version control at work? Are you being pestered by fellow PowerShell aficionados to start learning version control? Did you catch the PowerShell.org<a href="https://powershell.org/event/techsession-a-crash-course-in-version-control-and-git/">Crash Course in Version Control</a> and pick up some Git and GitHub experience? Shameless plug, sorry : )</p><p>Version control is just the start. What if we want to automate testing? To deploy our files, folders, and other artifacts out to production or other environments? Version control alone offers some nice benefits, but without these extra steps, it might introduce some pain points!</p><p>Developers have a bit of a head start on some of the interesting ideas and tools that streamline these processes. These will be increasingly important as IT professionals start to rely on version control. Let&rsquo;s take a quick look at a few key concepts.</p><h2 id="continuous-integration" class="ps-heading">Continuous Integration<a class="ps-heading-anchor" href="#continuous-integration" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Let&rsquo;s pretend we have a PowerShell project called ProjectX.</p><p>Traditionally, we might check this out of version control, work on it for days on end, and integrate it back into version control once we were done with some major component, or at some arbitrary interval (check in once a day!).</p><p>With<a href="https://en.wikipedia.org/wiki/Continuous_integration">continuous integration</a> (CI), we focus on making many small changes, integrating into version control often, rather than only after completing a major task, or at some pointless interval.</p><p>CI is often associated with running automated unit and integration tests, perhaps with<a href="https://www.youtube.com/watch?v=SftZCXG0KPA">Pester</a>.</p><p>You can get practical experience with this at home - set up a PowerShell project in GitHub, add some Pester tests, and sign up for AppVeyor - If you need some pointers, hit<a href="http://ramblingcookiemonster.github.io/GitHub-Pester-AppVeyor/">the walk through here</a>.</p><p>So! What does this look like? I make a change, commit to version control, tests automatically run, validate that I didn&rsquo;t break anything, and<a href="http://ramblingcookiemonster.github.io/GitHub-For-PowerShell-Projects/#continuous-integration">update my view from version control</a> to let me know the build is passing.</p><h2 id="continuous-deployment" class="ps-heading">Continuous Deployment<a class="ps-heading-anchor" href="#continuous-deployment" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Okay! We have our files in version control, and maybe we set up some automatic tests to run when we make a change. There&rsquo;s still a small problem. Will you remember to update the files where they actually live? Will you update those files outside of source control because this process is a pain? Continuous deployment (CD) can help with this.</p><p>For our purposes, the idea is that you can set up a series of validations, and if everything passes, you deploy to production.</p><p>While you can certainly involve<a href="https://en.wikipedia.org/wiki/Continuous_delivery#Principles">more gates</a>, you might have CI/CD pipeline that works as follows:</p><ul><li>You make a change</li><li>You commit to source control</li><li>Automated tests run</li><li>If the automated tests pass, the deployment runs</li></ul><p>So, now you don&rsquo;t need to worry about keeping production and other environments in sync with source control - this can all happen automatically!</p><p>We left out an important bit. What exactly happens with a deployment?</p><h2 id="psdeploy" class="ps-heading">PSDeploy<a class="ps-heading-anchor" href="#psdeploy" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>We use<a href="https://powershell.org/2015/06/04/automating-with-jenkins-and-powershell-on-windows/">Jenkins</a> at work. What if we move to TeamCity? or Bamboo? Or some other solution?<a href="http://ramblingcookiemonster.github.io/PSDeploy/">PSDeploy</a> is a quick and dirty module to help deployments on your preferred CI/CD platform.</p><p>Long story short, you have a deployment config file in each project. This spells out what you want to deploy (perhaps files or folders) and where to deploy them. You invoke PSDeploy, and it runs these deployments.</p><p>A few quick examples:</p><ul><li>We have a PowerShell module in version control.  Deployments.yml tells PSDeploy to copy the module to a network share, and a few servers.  Now, any time I commit a change to this module, Jenkins runs some Pester tests, and if they succeed, PSDeploy copies the module out. No extra work for me!</li><li>We have a repository that stores a variety of config files.  Deployments.yml tells PSDeploy to copy these config files out to the various shares and servers that need them.  John Doe, who struggled a bit with version control (imagine forcing them to use Jenkins!) pushes a commit, a few Pester tests run, and we deploy the config files out as needed.</li><li>We have an<em>everything but the kitchen sink</em> repository, containing scheduled task scripts, PowerShell session configuration scripts, and other files. Same deal. Commit to source control, tests run, these files are delivered to their homes.</li></ul><p>All I need to do in these cases is pick out what to deploy and where to deploy it to; PSDeploy does the rest. I can use the exact same build script for each of these projects, invoking PSDeploy against the deployments.yml.</p><p>What does this look like in practice? Here&rsquo;s a quick illustration:</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/PSDeployFlow.png"><img src="https://powershell.org/wp-content/uploads/2015/08/PSDeployFlowSmall.png" alt="PSDeployFlowSmall"/></p><p>There are certainly product-specific ways to do this, but if PSDeploy sounds interesting, you can<a href="http://ramblingcookiemonster.github.io/PSDeploy/">read more here</a>.</p><h2 id="next-steps" class="ps-heading">Next Steps<a class="ps-heading-anchor" href="#next-steps" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>That&rsquo;s about it! If you plan to start using version control, take a look at the concepts and tools that can make your life easier.</p><p><a href="http://ramblingcookiemonster.github.io/GitHub-Pester-AppVeyor/">GitHub, Pester, and AppVeyor</a> are a great free way to get started, but be sure to check out<a href="https://powershell.org/event/techsession-discovering-teamcity-and-build-powershell-org/">Dave Wyatt&rsquo;s TechSession on TeamCity and the Build.PowerShell.org</a>, which will cover a handy new service enabling free continuous integration and delivery for community PowerShell projects.</p><p>Lastly, I can&rsquo;t help but mention Steven Murawski&rsquo;s great post<a href="http://stevenmurawski.com/powershell/2015/8/moving-in-to-open-source">on joining the open source community</a>. This is a great way to learn, to get involved, and to help others - skim through his post, and definitely consider it!</p>
]]></content:encoded></item><item><title>What are variables anyway…</title><link>https://powershell.org/articles/2015-08-07-what-are-variables-anyway/</link><guid>https://powershell.org/articles/2015-08-07-what-are-variables-anyway/</guid><pubDate>Fri, 07 Aug 2015 09:03:51 +0000</pubDate><description>&lt;p&gt;Fellow Admins.&lt;/p&gt;
&lt;p&gt;A quick chat if you&amp;rsquo;re new to variables.&lt;/p&gt;
&lt;p&gt;So if you&amp;rsquo;re like me and don&amp;rsquo;t know any other programing/scripting language then all this PowerShell stuff is a bit daunting. So to help, this articles is on
PowerShell Variables. The thing is that Variables in PowerShell are very important. I&amp;rsquo;m assuming you know what a cmdlet is? The very basic underlying tools that make powershell work. They are like powershell building blocks or bricks in a PowerShell wall. For example, get-aduser gets a list of all the users in AD and includes a few details like SID, name and distinguished name. So that little cmdlet gets all that information, and more once you learn to manipulate it. If cmdlets are the bricks then Variables are the mortar. They hold all this information you have gathered together and let you save and pick and choose what you want.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Fellow Admins.</p><p>A quick chat if you&rsquo;re new to variables.</p><p>So if you&rsquo;re like me and don&rsquo;t know any other programing/scripting language then all this PowerShell stuff is a bit daunting. So to help, this articles is on
PowerShell Variables. The thing is that Variables in PowerShell are very important. I&rsquo;m assuming you know what a cmdlet is? The very basic underlying tools that make powershell work. They are like powershell building blocks or bricks in a PowerShell wall. For example, get-aduser gets a list of all the users in AD and includes a few details like SID, name and distinguished name. So that little cmdlet gets all that information, and more once you learn to manipulate it. If cmdlets are the bricks then Variables are the mortar. They hold all this information you have gathered together and let you save and pick and choose what you want.</p><p>Let&rsquo;s stick with get-aduser as an example. By the way, it&rsquo;s available if you have the AD module installed on your server. It will work out of the box if you try it on a domain controller but you can install it on other servers so you don&rsquo;t have to log  into your DC. The reason it&rsquo;s a good example is that if you have a thousand users then you get 1000 entries in your list when you use the get-ADuser cmdlet. Thats a lot of information and it may take some time for the cmdlet to finish running. Say you want just the names that start with P. And you also want to look at the users who were created in the last week. And you also want to see their email address. This is what a Variable is for. You run the cmdlet once, collecting all the user information, and then you have the information sitting there to use in anyway you want for as often as you want. There is a lot to learn about Variables but the most import thing is you understand the idea. So look at this&hellip;</p><p>$ADusers = get-ADuser</p><p>Powershell uses the $ sign to denote a variable. So these are variables. $servers, $comp, $process, and $Itdoesntmatterwhatthenameis. They are just containers - thats it!  And just like any bucket or plastic box you can put a label on it that is anything you like. But it must start with a $ so 
PowerShell knows it&rsquo;s a container. There is a cmdlet called new-variable for creating variables which you can explore but the easiest way is using the = sign. So now all the users in the domain are stored in the variable $ADusers. Let use another example. Say we wanted to work with services. We could use the get-service cmdlet and get a list of all the services on our machine. And if we want to work with them we can store them in a variable. Like this. $myservices = Get-service. So now if we enter $myservices in powershell and press enter, all the services gathered by the get-service cmdlet are listed.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/Services.png"><img src="https://powershell.org/wp-content/uploads/2015/08/Services.png" alt="Services"/></p><p>Now we get to work with a variable. Quite a lot of information is in our variable and we want to get some out. This is where we can use a thing called a pipeline. It is a big thing in 
PowerShell. I&rsquo;m not sure about other languages but for powershell it&rsquo;s like a production line. So we could do something like this. $myservices  | where {$_.name -like &ldquo;<em>spool</em>&rdquo;}.  That straight up and down bar is like a pipe from one part of the line to the next. They are a bit like filters.  So we have all this information in our variable but we only want to look at the print service. And worse I can&rsquo;t remember what the name of the print service is. Something about spool&hellip; No problem though because we told PowerShell to get something* like &ldquo;*spool&rdquo; and I&rsquo;m sure I&rsquo;ll recognise it.</p><p>So lets have a look at what happens when we run the line of script.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/SpoolerSVC.png"><img src="https://powershell.org/wp-content/uploads/2015/08/SpoolerSVC.png" alt="SpoolerSVC"/></p><p>You can do all kinds of things now you have all that information in the variable. We just extract what we want. Maybe you think to yourself&hellip;I wonder how many running services I have? Or how many are not running. Don&rsquo;t be concerned with the code you see here, as if you&rsquo;re beginning it is hard to get a handle on it all at once. The point is that the Variable has all this information stored and we can get it out. Variables are great if not essential in scripts as the script can do all these things once it collects the information for the Variable at the beginning. </p><p><img src="https://powershell.org/wp-content/uploads/2015/08/statuscount.png" alt="statuscount"/><p>There is something else about Variables that is really important to understand in PowerShell. And I have to say it took me quite a while to &ldquo;get it&rdquo;. PowerShell is an Object Orientated language.  It is very important to understand and deserves a blog post in it&rsquo;s own right. It&rsquo;s like saying it&rsquo;s a 3 dimensional language instead of a 2 dimensional language. So when we create a variable we are not just holding a word or a string we are holding an object. And objects are exciting! Because they hold heaps of information (properties)  and another another thing called methods. All of this is inside the variable. In the example above the &ldquo;name&rdquo; spooler is a property. It&rsquo;s like naming anything. Like a car. The cars name is Ford. But the method is drive, for example. There (hopefully) is also a method for stop. In our PowerShell example the method is count and the property we are looking for is status. Some properties have properties&hellip;like &ldquo;running&rdquo;. It can get complex. The thing is all this is in a variable and all of it you can access bit by bit when and how you want it.</p><p>In other languages variables have to be declared. There are lots of kinds of variables but PowerShell is smart enough to automatically work out what kind of variable it should be looking at. So declaring a variable is usually not needed. The problem in Powershell is that most of the time the automatic part works well &hellip;. so well sometimes I forget that variables can be declared. Sometimes the script just doesn&rsquo;t work like you thought it would. It turns out you need to declare the variable. And sometimes you want to because there are some juicy methods you want to get to. Image you want to work with a date. 12/05/15. So you put it in a variable called $date. $date = &ldquo;12/05/15&rdquo;. Remember we talked about methods. Methods are things we can do. By the way that date is just some writing. It&rsquo;s basic. What PowerShell thinks is, that it&rsquo;s a sting. Like this: [string]$date. That&rsquo;s how you can declare a variable in PowerShell. Use [] and the appropriate syntax. If you want to work with numbers [int]$date and PowerShell knows you want to work with numbers. In out case we want to work with a date. So we declare our variable. [datetime]$date. There is a very cool cmdlet called get-member that shows all the properties and methods (and other things) in a variable. Check this out. This is what<em>$date | get-member</em>  gives us when we don&rsquo;t declare the variable.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/stringmethod.png"><img src="https://powershell.org/wp-content/uploads/2015/08/stringmethod.png" alt="stringmethod"/></p><p>All those methods let you do things to the content of the variable. Like<em>toupper</em>. That will make all the letters capital. Or<em>replace</em>. Lets you replace letter or words in a string stored in the variable. But we don&rsquo;t want that! We want to work with our date! Now check this out&hellip; [datetime]$date | get-member</p><p><img src="https://powershell.org/wp-content/uploads/2015/08/datemethods.png" alt="datemethods"/><p>It&rsquo;s totally different. There&rsquo;s all those juicy properties like<em>month,minute</em> and<em>dayofyear</em>. And cool methods like<em>todatetime</em>, and<em>tolongdatestring</em>. So now that we have made available <em>tolongdatestring</em> we can use it like this_. _Our 12/05/15 has become Saturday, 5 December 2015. If we hadn&rsquo;t declared our variable we wouldn&rsquo;t have been able to do that.</p><p><a href="https://powershell.org/wp-content/uploads/2015/08/tolongdate2.png"><img src="https://powershell.org/wp-content/uploads/2015/08/tolongdate2.png" alt="tolongdate2"/></p><p>Hopefully if you didn&rsquo;t know what those $ sign things were you now have a better idea. Oh and that . in the .count or .tolongdatestring is so cool. I had no idea when I was starting out and you should try looking up . on the internet. That . is like a short cut to get into the variables and access methods or properties. $myservice.name, $myservice.status, and $myservice.displayname will give just those properties.  All that complexity is yours to play with, explore and use once it&rsquo;s stored in a variable. </p><p>Keep practicing, PowerShell is the best thing since Windows.</p><p>Steve</p>
]]></content:encoded></item><item><title>MSPSUG Virtual Meeting: Conquering Azure and Office 365 with PowerShell – August 11th 2015</title><link>https://powershell.org/articles/2015-08-05-mspsug-virtual-meeting-conquering-azure-and-office-365-with-powershell-august-11th-2015/</link><guid>https://powershell.org/articles/2015-08-05-mspsug-virtual-meeting-conquering-azure-and-office-365-with-powershell-august-11th-2015/</guid><pubDate>Wed, 05 Aug 2015 14:49:49 +0000</pubDate><description>&lt;p&gt;Join the Mississippi PowerShell User Group virtually on Tuesday, August 11th at 8:30pm Central Time when SharePoint MVP &lt;a href="http://www.toddklindt.com/blog/default.aspx"&gt;Todd Klindt&lt;/a&gt; will present “
&lt;em&gt;**Conquering Azure and Office 365 with PowerShell **&lt;/em&gt;
”.&lt;/p&gt;
&lt;p&gt;After years and years of anticipation, 2015 might end up actually being the year of the Cloud. With any new technology comes the opportunity to tame it with PowerShell. In this session Todd will give you an overview of the PowerShell options you have when interacting with Office 365 and Azure. He’ll go over how to get them installed in your environment. Then he’ll walk you through getting them connected to Office 365 and Azure and actually doing some work with them. Finally he’ll show you some tricks to get around the limitations. When this session is finished you’ll be armed with all the information you need to fire up PowerShell and wrangle Office 365 and Azure AD into submission.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Join the Mississippi PowerShell User Group virtually on Tuesday, August 11th at 8:30pm Central Time when SharePoint MVP<a href="http://www.toddklindt.com/blog/default.aspx">Todd Klindt</a> will present “<em>**Conquering Azure and Office 365 with PowerShell **</em>
”.</p><p>After years and years of anticipation, 2015 might end up actually being the year of the Cloud. With any new technology comes the opportunity to tame it with PowerShell. In this session Todd will give you an overview of the PowerShell options you have when interacting with Office 365 and Azure. He’ll go over how to get them installed in your environment. Then he’ll walk you through getting them connected to Office 365 and Azure and actually doing some work with them. Finally he’ll show you some tricks to get around the limitations. When this session is finished you’ll be armed with all the information you need to fire up PowerShell and wrangle Office 365 and Azure AD into submission.</p><p>Visit the<a href="http://mspsug.com/2015/08/02/mspsug-virtual-meeting-conquering-azure-and-office-365-with-powershell-on-tuesday-august-11th-at-830pm-cdt/">Mississippi PowerShell User Group</a>
website to learn more about Todd and to find out more details about this month’s meeting.</p><p>The Mississippi PowerShell User Group Meetings are held online (via Skype for Business) on the second Tuesday of each month at 8:30pm Central Time and are free to attend. The system requirements to attend these online meetings can be found on the MSPSUG website under the “<a href="http://mspsug.com/attendee-info/">Attendee Info</a>” section.</p><p>Register via<a href="http://mspsug.eventbrite.com/">EventBrite</a> to receive the URL for this meeting.</p><p>µ</p>
]]></content:encoded></item><item><title>PowerShell Summit North America 2016 – Call for Topics</title><link>https://powershell.org/articles/2015-08-03-powershell-summit-north-america-2016-call-for-topics/</link><guid>https://powershell.org/articles/2015-08-03-powershell-summit-north-america-2016-call-for-topics/</guid><pubDate>Mon, 03 Aug 2015 16:39:58 +0000</pubDate><description>&lt;p&gt;**&lt;/p&gt;
&lt;p&gt;PowerShell Summit NA 2016 – Call for Topics&lt;/p&gt;
&lt;p&gt;**&lt;/p&gt;
&lt;p&gt;The PowerShell Summit is the number one conference where PowerShell enthusiasts gather and learn from each other in fast-paced, knowledge packed presentations. PowerShell experts from all over the world including MVP’s, Guru’s, community leaders and PowerShell team members, will once again join together for a few days in Bellevue, WA. to discuss and learn about maximizing PowerShell in the workplace. If you want to share your PowerShell expertise or story, then this is your official call to submit presentations for selection!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>**</p><p>PowerShell Summit NA 2016 – Call for Topics</p><p>**</p><p>The PowerShell Summit is the number one conference where PowerShell enthusiasts gather and learn from each other in fast-paced, knowledge packed presentations. PowerShell experts from all over the world including MVP’s, Guru’s, community leaders and PowerShell team members, will once again join together for a few days in Bellevue, WA. to discuss and learn about maximizing PowerShell in the workplace. If you want to share your PowerShell expertise or story, then this is your official call to submit presentations for selection!</p><p>PowerShell Summit North America 2016 will be held 4-6 April in the Meydenbauer center, Bellevue WA.</p><p>**</p><p>Topic Areas – What we are looking for</p><p>**</p><p>We are looking for 45-minute presentations covering a wide aspect of PowerShell expertise. We have two main topic areas that may assist you in building an abstract.</p><p>PowerShell Internals – A deep look into the inside workings of PowerShell and practical solutions that are built from them. These presentations are typically more directed to the PowerShell development community that is building extensions and solutions relating to PowerShell.</p><p>PowerShell Features Deep Dive – These presentations are a deep look into configuring and working with PowerShell features and capabilities such as Remoting, Desired State Configuration and more. These presentations tend to be more IT Pro focused.</p><p>We are open to presentations across the entire ecosystem that has been built around PowerShell; so don’t hesitate to send an abstract for your particular area of expertise. This includes Microsoft platforms and products that have PowerShell-based management tools as well as 3rd parties such as VMware. New topics will be preferred over recycling of older topics – look to see what’s new in PowerShell 5.0 and use the questions on PowerShell.org to spot areas of confusion that could supply a good session for the Summit.</p><p>_</p><p>We may consider double length sessions, but only in exceptional cases. Please contact us –</p><p><em>[</em></p><p><a href="mailto:summit@powershell.org">summit@powershell.org</a></p><p><em>]<a href="mailto:summit@powershell.org">1</a></em></p><p>– with your idea before spending too much time developing such a session.</p><p>_</p><p>**</p><p> What kind of sessions get selected?</p><p>**</p><p>We’re looking for sessions that go beyond – way beyond – “beginner.” If you want to see examples of the depth we’re looking for use the recordings on the PowerShell.org Youtube channel from the PowerShell Summit Europe 2014, or PowerShell Summit NA 2015 as a guide. We look for an abstract that’s compelling and makes us salivate to see your session – so spend time writing a punchy abstract! We want sessions that offer real-world usability combined with “wow, nobody talks about THAT” awesomeness. If in doubt aim high, very high. Remember, Summit sessions are recorded, so if you’ve previously presented a topic at a Summit, we’re less likely to choose it for another Summit. We want sessions that are challenging, and that ideally present things that simply aren’t explained or documented elsewhere. New modules, new techniques, and crazy approaches are all welcome. Discussion-format sessions are great, too, especially if you plan to turn them into a community deliverable (like a “best practices for writing DSC Resources” session that gets turned into a free e-guide later). Think community, deep dive, engaging, and amazing as keywords. We want attendees to finish each day with information leaking… just a little bit… out their eyeballs. Help us make it happen.</p><p>_</p><p>If you have any doubts about the suitability of a particular session please contact us -</p><p><em>[</em></p><p><a href="mailto:summit@powershell.org">summit@powershell.org</a></p><p><em>]<a href="mailto:summit@powershell.org">1</a></em></p><p>– we’re always happy to discuss proposed sessions.</p><p>_</p><p>We do have some goals for speaker selection, too. We obviously have, and appreciate, the great involvement we get from the product team. We aim to have a certain number of sessions from well-known members of the community, simply because they’re well-known for a reason – they do a great job! But we also set aside slots for newcomers who’ve never presented before, or who’ve maybe only presented once or twice before – the audience will judge you on content not style. We want to create opportunities for more folks to become engaged and active in our community, and the Summit is a great way to do that.</p><p>We aren’t looking for soft-skills sessions, like “how to get a new user group running,” although contact us via email (<a href="mailto:summit@powershell.org">summit@powershell.org</a>) if you’d like to do something like that as an extra evening thing after the main content wraps for the day.</p><p>Please note all sessions are to be delivered in English. Presenter will provide all equipment needed to deliver session(s), including a laptop or other computer. Presenter must be able to provide video by means of HDMI, DVI-D, or DisplayPort connectors – VGA is<strong>NOT</strong> supported. Presenter must be able to manually select an appropriate screen resolution for video output. Typically, 1024×768 or 1280×720 are preferred.</p><p>**</p><p>How to submit abstracts of presentations</p><p>**</p><p>Presentations will be 45-minutes in length and the submission should include the following:</p><p>Presentation Title</p><p>Presentation abstract – a description of the presentation and the topics covered. 250 words or less and suitable for marketing.&lt;/ span&gt;</p><p>Go to</p><p><a href="https://eventloom.com/event/register/PSNA16/Speaker?preregister=1">
https://eventloom.com/event/register/PSNA16/Speaker?preregister=1</a></p><p>.</p><p>This is the only valid URL for pre-registration. Provide your e-mail address, password, and confirm password. You’re creating a new account, even if you’ve attended past Summit events.</p><p>**</p><p>DO NOT ATTEMPT TO REGISTER FOR THE SUMMIT AS AN ATTENDEE AT THIS STAGE – WE WILL BE OPENING REGISTRATION IN NOVEMBER 2015. ANY NON-SPEAKER REGISTRATIONS WILL BE DELETED.</p><p>**</p><p>Click Abstracts on the top menu</p><p>Click SUBMIT ABSTRACT</p><p>Enter Title and Description.</p><p>Click SUBMIT</p><p>Provide a title and description; descriptions must be 50-250 words. Set the Status to “Ready to Review” when you are ready to send your session to us for consideration.</p><p>To return to the site at a later time, go to</p><p><a href="https://eventloom.com/event/login/PSNA16">
https://eventloom.com/event/login/PSNA16</a></p><p>Click Log In. You can then re-visit Abstracts.</p><p>Note that you must set your abstract status to<strong>Ready for Review</strong> or we won’t see it. If you leave it in **Pending, **it won’t be considered.</p><p>You can submit multiple presentations in the same topic area or for different ones. Be aware that even though the session length is 45 minutes we prefer to have at least 10 minutes set aside for questions. Summit presentations are intense and intimate often with plenty of audience interaction. You must expect questions and discussions. This is not a “lecture to the audience” event. Also because of the session length, generally co-presenters are unnecessary, but that is not a requirement.</p><p>**</p><p>Presentation submission deadline – When you should send it by</p><p>**</p><p>Start sending your presentation submissions immediately! The selection committee will start selecting presentations as soon as they arrive so you don’t want to miss out. The last day we will accept presentation submissions will be<strong>Thursday 1 October 2015</strong>. This is a<strong>hard</strong> deadline – no sessions will be accepted after this date.</p><p>**</p><p>When you will know you’ve been selected</p><p>**</p><p>The selection committee will start reviewing submissions immediately and begin the selection process. You will be informed if one or more of your presentations have been selected and notified by Thursday 15 October 2015.</p><p>You will need to log back onto the event site and complete your registration with the code we will provide in the notification email. This will have to occur before 31 October 2015 so that we have a completed agenda in time for attendee registration.</p><p>Speakers, with accepted sessions, will be given free admission to the event, including attendance at all official Summit activities. However, AWPP membership is not included. Speakers may not bring guests to the day sessions or evening events. We have a limited budget, and the number of speakers selected will be partially governed by that budget.</p><p>Pre-registering does not guarantee you a place at the event. Pre-registration is until 1 October 2015. Final session selections will be made by 15 October 2015, and you will be notified of accepted/unaccepted sessions.</p><p>If at least two sessions are accepted, you will be asked to immediately make a reservation at our speaker hotel. You will be given our group code, and we will directly pay for up to 3 nights’ lodging. Any additional nights are your responsibility as are travel and other costs.</p><p>If any sessions are accepted, you will be asked to immediately complete your Summit registration using a free promotional code. If you do not complete your registration by 1 November 2015, then we will assume you do not wish to present and your sessions will be cancelled, and the slots offered to another speaker.</p><p>If no sessions are accepted, then your pre-registration will be deleted. Beginning 1 November 2015 and through 4 March 2016, you are welcome to create a new account and register as a standard attendee on a space-available basis.</p><p>The final agenda will be announced and posted on PowerShell.Org on, or about, Sunday 1 November 2015.</p><p>We look forward to your submissions and your help in making PowerShell Summit North America 2016 the most valuable IT/Dev conference of the year building on and surpassing the previous Summits!</p>
]]></content:encoded></item><item><title>2015-August Scripting Games Puzzle</title><link>https://powershell.org/articles/2015-08-01-august-2015-scripting-games-puzzle/</link><guid>https://powershell.org/articles/2015-08-01-august-2015-scripting-games-puzzle/</guid><pubDate>Sat, 01 Aug 2015 13:10:40 +0000</pubDate><description>&lt;p&gt;Our August 2015 puzzler tests your ability to retrieve data from the Web. If you&amp;rsquo;ve never done this before, it can be a real brain-bender - but don&amp;rsquo;t overthink it; experts can probably pull this off in a one-liner if they&amp;rsquo;re using a newer version of PowerShell!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Our August 2015 puzzler tests your ability to retrieve data from the Web. If you&rsquo;ve never done this before, it can be a real brain-bender - but don&rsquo;t overthink it; experts can probably pull this off in a one-liner if they&rsquo;re using a newer version of PowerShell!</p><h2 id="instructions" class="ps-heading"><strong>Instructions</strong><a class="ps-heading-anchor" href="#instructions" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The Scripting Games have been re-imagined as a monthly puzzle. We publish puzzles the first Saturday of each month, along with solutions and commentary for the previous month&rsquo;s puzzle. You can find them all at<a href="https://powershell.org/category/announcements/scripting-games/">https://powershell.org/category/announcements/scripting-games/</a>. Many puzzles will include optional challenges, that you can use to really push your skills.</p><p><strong>To participate</strong>, add your solution to a public Gist (<a href="http://gist.github.com">http://gist.github.com</a>; you&rsquo;ll need a free GitHub account, which all PowerShellers should have anyway). After creating your public Gist, just copy the URL from your browser window and paste it, by itself, as a comment of this post. 
**Only post one entry per person. You are not allowed to come back and post corrected or improved versions. If you do, all of your posts will be ignored. **However, remember that you can always go back and edit your Gist. We&rsquo;ll always pull the most recent one when we display it, so there&rsquo;s no need to post multiple entries if you want to make an edit.</p><p>Don&rsquo;t forget the <a href="https://powershell.org/?p=2574">main rules and purpose of these monthly puzzles</a>, including the fact that you won&rsquo;t receive individual scoring or commentary on your entry.</p><p><strong>User groups are encouraged to work together</strong> on the monthly puzzles. User group leaders should submit their group&rsquo;s best entry to Ed Wilson, the Scripting Guy, via e-mail, prior to the third Saturday of the month. On the last Saturday of the month, Ed will post his favorite, along with commentary and excerpts from noteworthy entries. The user group with the most &ldquo;favorite&rdquo; entries of the year will win a grand prize from PowerShell.org.</p><h2 id="heading" class="ps-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><h2 id="our-puzzle" class="ps-heading"><strong>Our Puzzle</strong><a class="ps-heading-anchor" href="#our-puzzle" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>At<a href="https://www.telize.com/geoip">www.telize.com/geoip</a>, you&rsquo;ll find a JavaScript Object Notation endpoint. It&rsquo;s public. Your goal is to get PowerShell to display something like the following (because this is based on <em>your</em> IP address, the property values will be different than what&rsquo;s shown here):</p><p>`longitude latitude continent_code timezone</p><hr><p>-115.1685 36.2212 NA America/Los_Angeles
`Being able to query information from the Web - often in XML or JavaScript Object Notation - is an important integration skill. PowerShell can actually make it pretty easy. Although this challenge <em>can</em> be solved using a one-liner, you could also go further and write a complete &ldquo;Get-GeoInformation&rdquo; function around it. However, keep in mind that a function would not normally (a) limit the data that&rsquo;s output or (b) pre-format the data. Why not?</p><p><strong>Challenges:</strong></p><ul><li>Try to do this in a one-liner, but spell out all command and parameter names.</li><li>Write an advanced function that provides a complete Get-GeoInformation &ldquo;wrapper&rdquo; around this endpoint.</li><li>Along with your entry, include the endpoint for another XML or JavaScript Object Notation web service that you think is cool, along with a brief notation of what it does</li></ul>]]></content:encoded></item></channel></rss>