Articles

PowerShell articles, tutorials, and guides from community experts.

Steve Parankewich
DevOps

Connect to all Office 365 Services with PowerShell

If you are not on Office 365 or have a tenant set up with Microsoft yet, now is the time to reserve your tenant name! With utilizing Office 365, a lot of administration is only available from a PowerShell session. There is a mix of outdated information on what you actually need to install and execute in order to connect to all of the Office 365 services. As a result, I accumulated and wrote up the current download requirements and commands to connect and administer every Office 365 service from one PowerShell session. I hope this saves everyone a lot of time and effort!
Head over to PowerShellBlogger.com to read the full article here.

Don Jones
PowerShell Summit

PowerShellSummit.org Registration Status for 2-Feb-2016 (also, recordings)

OK, here’s a quick update of where we’re at with registration for PowerShell + DevOps Global Summit 2016.
We’d originally scheduled 150 seats for the April event, inclusive of speakers. Yesterday (1st Feb) we opened 3-day sales (previously, only 4-day seats had been available), and are now at 126 total attendees. So we’ve got 24 seats of our original space remaining.
The venue assures us that we can accommodate at least another 25 people, possible as many as 50 more. So we’re working with them to make that happen - in the meantime, I strongly recommend you register soon if you plan to attend. It looks like, no matter what, we’ll be in a sellout situation again this year.
Now, keep in mind that we’ve greatly expanded the event this year. We’re running three full-day pre-conference workshops (that’s what you get for the extra day in the 4-day pass). We’re having an informal gathering on Sunday evening (after the pre-cons) at the Courtyard Downtown Bellevue, a bar crawl Monday night, and a reception with the WMF team on Tuesday evening. In addition to two tracks of content, we have a third track which will run some extra-long sessions (although not all day). We’re also welcoming the WMF team on Tuesday after lunch for a “State of the Shell” address by two of the main team leaders, followed by “Lightning Demos” from a variety of team members. It’s a lot of content.
As always, we’ll be recording most of the sessions. Basically, the pre-con sessions won’t be recorded, nor will the extra-long “bonus” sessions in the third track (we only have two sets of recording gear). All of what we do record will go on YouTube as usual. However, this year, Pluralsight will be on-hand with camera crews in our two main rooms, and they’ll be producing recordings that include screen capture as well as live video of the speakers. Those “better” recordings will go into the Pluralsight library, and everyone attending in person will receive free access to those even if you don’t have a subscription. For anyone not attending, you can either access our screen-caps on YouTube for free, or use a Pluralsight subscription to access the nicer videos. This is an experiment with Pluralsight and we appreciate their support!
Oh, and we’ll also be offering Verified Effective exams (no computer required!) on Wednesday, to anyone who’s interested (no advance registration required).
Anyway, as you can see, it’s going to be a busy-busy-busy Summit, and it’s looking firmly to be a sellout, even if we’re able to secure the extra space at the venue. So register right the heck now if you plan to attend. If you’re just now getting around to talking the boss into it - well, honestly, you shoulda started back in November ;). At $950 for the 3-day pass, though, this is probably the best educational deal you or your company will ever find, and more than a few people see enough value to pay their own way every year.
So I hope we’ll see you there!

timpringle

Using PowerShell to make Azure Automation Graphical Runbooks – Part 1

Microsoft recently released another extension for Azure Automation developers, this time in the form of the Microsoft Azure Automation Graphical Authoring SDK.
This SDK allows developers to make and edit graphic runbooks for using in Azure Automation. Although the examples given are in C#, it’s possible to apply the same methodologies to develop them in PowerShell with the accompanying SDK mentioned above.
You can read the first article of this series on creating these Graphical Runbooks at powershell.amsterdam

Don Jones
PowerShell Summit

PowerShell + DevOps Global Summit 2016 Registration Status

A quick status update on Summit:

  • We’re currently past our 50% registration point. Right now, only 4-day registrations are available. Register at https://eventloom.com/event/home/PSNA16.
  • In just a few days, on February 1st, we’ll open all remaining seats for both 3- and 4-day registrations (same registration URL).
  • Registration ends during the first week of March. At that time, we’ll review the situation, and may be able to open additional seats. However, the price will go up a bit. Our absolute final date for registrations will be March 20th.

So you’ve got about 3 days before 3-day registration opens, and from there about a month to sign up. After that, if we have additional space or can make additional space, we’ll open more seats - but the price will be higher.
If you’re attending, don’t forget to head over to http://www.zazzle.com/collections/powershell_devops_global_summit_2016-119347973985746667 to pick up an official conference t-shirt, hat, coffee mug, or notebook to bring with you! We also have commemorative tiles available, and will offer a new one each year for you to collect.

Matthew Hodgkins
DevOps

Using PowerShell to enable ChatOps on Windows

ChatOps is a term used to describe bringing development or operations work that is already happening in the background into a common chat room. It involves having everyone in the team in a single chat room, then bringing tools into the room so everyone can automate, collaborate and see how automation is used to solve problems. In doing so, you are unifying the communication about what work gets done and have a history of it happening.
ChatOps can be supplemented with the use of tools or scripts exposed using a chat bot. Users in the chat room can talk to the bot and have it take actions on their behalf, some examples of this may be:

Steve Parankewich
DevOps

Create Windows Shortcuts or Favorites With PowerShell

Creating windows shortcuts are usually done through the New Shortcut Wizard, MSI files, Group Policy Objects, or even a simple file copy. Shortcut files are .lnk files that Microsoft Windows uses for shortcuts to local files while .url is used for destinations such as web sites. As we all are aware, the .lnk filename extension is hidden in Windows Explorer even when “Hide extensions for known file types” is unchecked in File Type options. The reason for this is the NeverShowExt string value in HKEY_CLASSES_ROOT\lnkfile. Shortcuts are also displayed with a curled arrow overlay icon. The IsShortcut string value causes the arrow to be displayed.
For a full run down on creating shortcuts and favorites with PowerShell head over to PowerShellBlogger.com.

timpringle
PowerShell for Admins

Using Local Functions in a Scriptblock with Existing Code

When you are wanting to run code remotely, it’s common to do this via the use of Invoke-Command (though other options exist, such as through Start-Job for example). The biggest downfall to date i’ve found with remoting is the lack of an option to combine the use of your local functions within a ScriptBlock that has other code in it. As an example, the following is not possible:

function Add ($param1, $param2) { $param1 + $param2 } function Multiply($param1,$param2) { $param1 * $param2 } Invoke-Command -ComputerName $env:COMPUTERNAME -ScriptBlock { $addResult = Add $args[0] $args[1] $multiplyResult = Multiply $args[0] $args[1] Write-Output "The result of the addition was : $addResult" Write-Output "The result of the multiplication was : $multiplyResult" } -ArgumentList 3, 2 However, there is a way to achieve this type of operation, and make as many local functions as you want available to be used and combined with other code in your ScriptBlock. You can find the full article at powershell.amsterdam.

Steve Parankewich
DevOps

Improve Delivery of PowerShell Tools or Version Controlled Files

I am back this week with a quick how-to article on delivering, installing, or launching version controlled files. In the past I ran into problems when having administrators launch my PowerShell tools from a network share. The performance was slow when launching it across the WAN, and the file would often be locked when I tried to replace it with a newer version. I came up with a solution to the problem by using none other than PowerShell.
The solution dips into all kinds of PowerShell techniques including local environment variables, getting text file contents, file version checking and even shortcut (.lnk) creation. If you are also a user of Sapien’s PowerShell Studio, then definitely give this one a read. Check out the solution over on PowerShellBlogger.com.

Stephen Owen

Atlanta PowerShell User's Group Meeting – January 19th 'Let's win the scripting games!'

Kicking off in our new venue, we’ll be tackling this month’s PowerShell.org monthly scripting games challenge! Prizes are given to the group with the best answers over the year, so let’s try our best! Have an idea or want to cover a topic? Let us know my messaging Mark Schill or myself (Stephen Owen)
Here’s the link to the puzzle for this month. I would recommend that you look it over, and begin thinking of how you might approach it. However, let’s let everyone have a chance to answer the puzzle and work through it as a team 🙂
Register now on Meetup!MeetUp

Steve Parankewich
Announcements

New Boston PowerShell User Group

Its a new year with new goals and I hope to provide even more assistance and value to the PowerShell community in 2016. I have created a new Boston based PowerShell user group and will be working hard on creating sessions as frequently and regularly as possible. If you are in the greater Boston or New England area please join the user group. If we have any Microsoft employees or PowerShell MVPs visiting the Boston area in the future, we would love to have you deliver a session. I have arranged booking of a room in the Microsoft Technology Center located at Kendall Square, 255 Main Street, Cambridge, MA 02142 when required. I will also look into offering the meetings over Skype for Business if possible.
Check out and join the Boston PowerShell User Group here: http://www.meetup.com/Boston-PowerShell-User-Group