Search
Generic filters
Exact matches only
Filter by Custom Post Type

PowerShell Saturday Chattanooga - A Recap

This past weekend the Chattanooga PowerShell User Group hosted 65 attendees from 14 states for our 1st (hopefully annually) PowerShell Saturday. Chattanooga State Community College was an amazing venue for our little conference. When we started out we were only going to do a Saturday event. Then Jeff Hicks said he would do a per-conference for us. Little did we know that 95% of the attendees would by a 2 day pass and attend the per-conference and the Saturday Event.

We started Thursday evening at Scotties on the River a local restaurant in town that just happened to be connected to the hotel were most of the out of town attendees were staying (great seafood by the way). We under estimated the number of people that would be joining us so we had to sit at two different tables and at any other conference this would have been fine. But not a PowerShell event, we took turns rotating among the tables to make sure we could talk to everyone. After dinner we moved to the patio and talked shop until they kicked us out.

Friday was an all-day PowerShell Automation Workshop presented by Jeff Hicks. By the end of the day my head was ready to explode with all the PowerShell Awesomeness I was learning. Saturday was the big day. 15 sessions, 3 rooms 5 hours. At this point everything was going too smoothly that I was ready for something to go terribly wrong. But breakfast was on time, everyone showed up and most of the attendees already knew which sessions they were going to. Next thing I know its lunch time. We did discover that we left to much time for lunch however. The rest of the day went exactly as planned. Nothing went BOOM and everyone had a great weekend of PowerShell.

Thanks to the DevOps Collective PowerShell Saturday Booster Program we were able to avoid most if not all of our roadblocks. The first step of the booster program is to write up a business plan, the Who, What, When, Where, Why. By answering all of these questions up front we had a clear path in front of us. We knew where we wanted to go and thanks to the business plan (with help from Don Jones and Jeff Hicks) we were able to produce an AMAZING conference with some of the BEST presenters that we could ask for.

So the big question still remains, are we going to do it again in 2019? We gave this a lot of thought and decided that in August 2019 we will be presenting ‘PowerShell on the River’ a 2 day Conference brought to you by the Chattanooga PowerShell User group. Exact dates will be announced later as we still have to work to secure a venue.

Thanks again to everyone to helped make this weekend a success.

We Need Your Help.

We need your help. 

As you may have heard, we’re launching a new “OnRamp” track at PowerShell + DevOps Global Summit 2019. Limited to 40 students, this will be a hands-on class designed to bootstrap someone into the technology and our community. There's a whole brochure about it!

We’re also offering a number of free-ride scholarships designed to cover admission, air, and hotel, to help increase the diversity of our field and community right at the top of the funnel. Half of our scholarships will be awarded to individuals from groups that are traditionally underrepresented in IT, and that’s where we need your help. 

We need to get the word out to potential applicants so that they know to apply!

Read more

PowerShell + DevOps Global Summit Scholarship Program

Automation and scripting has become a major part of IT in recent years.  And PowerShell has played a giant role in the progression of that.  Every year, the wonderful people at PowerShell.org put on the PowerShell + DevOps Global Summit, that always produces outstanding results from amazing speakers and attendees.

As many of you in IT know, convincing your manager to attend conferences usually depends on a few key factors: Cost and budget, content, and sometimes, experience or seniority in the company.  And unfortunately, that last one may be a deciding factor far too often.  This year, PowerShell.org is making it a priority to help extend, not only the content and knowledge that comes with attending the PowerShell + DevOps Global Summit, but also the experience that comes along with it.  

PowerShell.org is looking for a few driven, over achieving PowerShell-ers, that may still yet be all too green in their company or role in IT to convince their superiors to send them to the PowerShell + DevOps Global Summit.  To be considered for this scholarship, we are particularly looking for individuals that would be considered part of a group which is "under represented" in the IT industry as a whole, including women, underrepresented minorities, and so on.  So, if you're the IT Director, or the Senior Systems Architect, this opportunity is not for you; however, if you are in those roles, and you know a real go-getter that has shown you some cool stuff they have done with PowerShell, please point them to this opportunity.

It's also worth noting that this specifically isn't for people in the situation of, "yeah, I do this stuff all the time and my employer should totally send me and they totally aren't." We're looking more for, "I'm working way above my pay grade and this might help give me the jump I need to get to a better place in life." That's the kind of thing you'll have to help us understand about you in your application. This scholarship isn't just to take a burden off your employer or net you a free trip to Redmond; it's to help someone raise themselves in life.

 

Applying

If you feel you fit the bill for this scholarship, you need to convince us!  We want to hear why you are the Chosen One.  So, if you’d like to be considered for the opportunity you will need to write an essay that demonstrates your passion for PowerShell and automation.  When constructing your essay, please use the following guidelines:

  • Demonstrate an intermediate or better understanding of PowerShell,  Scripting, and ToolMaking (If you’ve read Don Jones’ Learn PowerShell in a Month of Lunches, you should be fine).
  • Include specifics.  Site specific example on how you have used PowerShell to save your company a bunch of money, or how you’ve done something amazing.
  • Include examples.  We DO NOT want a submission that is just a script, but please include some clever snippets that you are proud of.
  • Have you shared your work, or made it reusable?  Please include information on how we can find it if you have.  The PowerShell Community is one of the best ones around, and we all love sharing code.
  • Be thorough.  We don’t have a hard word count,  but remember, the best essay wins!
  • Assure us that, should you be awarded this opportunity, you've spoken with your employer and getting the time off won't be a problem.

 

How We'll Decide

  • Applications can be submitted HERE (Google account required to apply).
  • We will be accepting applications from Friday, September 1st 2017 until Sunday, October 1st 2017.
  • The winner(s) will be selected based on the quality of their essay and the enthusiasm it conveys (make us want to keep reading).  Again, we are not looking for the seasoned PowerShell veteran that has been to the Summit the past four years, but the help desk analyst that has been using a collection of tools and scripts they created that is allowing them to be four times as productive.
  • The winner(s) will be chosen by a panel of four judges who are all very active members in the PowerShell community.
  • The winner(s) will be announced Wednesday, November 1st 2017 on PowerShell.org

 

What Awardees Receive

  • Up to $500 in airfare.
  • Four hotel room nights.
  • Full admission to the PowerShell + DevOps Global Summit.

Taking Powershell to the next level

Jun 22, 2017
1

I recently decided to 'up my game' with powershell and go beyond the simple scripts I've rolled out in the past.

So I simply want to share with you, the path I took to enhance my skills (inc. alot of practice)

Books:

Learn Powershell In A Month of Lunches

Learn Powershell Toolmaking in a month of Lunches

Windows Powershell In Action 3rd Edition

Online:

Advanced Tools And Scripting with Powershell 3.0 Jump Start

Writing Powershell Powershell DSC Resources And Configuration

Demo Code

 

Pester – Parameters and Hashtable Fun!

I have written a short excerpt on how to pass parameters from an object to a Pester test. I have turned this into a function: Invoke-POVTest.

The function is primarily for operational validation tests, where you might have a single operational test but you need to test multiple cases. (Sorry, I am not quite sure if I described it properly).

I'll be interested in any feedback.

 

Link to blog post here.

 

Complete Guide to PowerShell Punctuation

Quick as you can, can you explain what each of these different parentheses-, brace-, and bracket-laden expressions does?

${save-items}
${C:tmp.txt}
$($x=1;$y=2;$x;$y)
(1,2,3 -join '*')
(8 + 4)/2
$hashTable.ContainsKey($x)
@(1)
@{abc='hello'}
{param($color="red"); "color=$color"}
$hash['blue']
[Regex]::Escape($x)
[int]"5.2"

When you're reading someone else's PowerShell code, you will come across many of these constructs, and more. And you know how challenging it can be to search for punctuation on the web (symbolhound.com not withstanding) !

That is why I put together a reference chart containing all of PowerShell's symbology on one page. making it much easier when you need to look up a PowerShell symbol as you read code--or to browse for the right construct when you are writing code.

PowerShell Punctuation wall chart

Download the Complete Guide to PowerShell Punctuation wallchart from here.

Convert VBA Macros To PowerShell for Microsoft Office Automation

There is a lot of documentation out there for interacting with Microsoft Office including Outlook, Excel, Word, etc with Visual Basic for Applications (VBA). A lot of time you may only be able to find VBA examples. VBA's require template files to be sent to the desktop and are a real hassle when trying to automate across multiple machines.

There are not many A to B examples of translating VBA to PowerShell so I took a problem I had solved in the past and presented the before and after. Hopefully it will provide enough information to allow others to convert VBA code into PowerShell for their scenarios.

You can check out the full article on PowerShellBlogger.com.

 

 

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.

Testing PowerShell Direct with Windows Server 2016 TP3 Hyper-V

Hey there! I  thought we could test PowerShell Direct together today. Here's the elevator pitch: In Windows Server 2016 and Windows 10, we can send PowerShell commands from the Hyper-V host directly to its corresponding virtual machines (VMs), even in the absence of guest VM networking. Yeah, that's cool, isn't it?

What's just as impressive is that PowerShell Direct works even if PowerShell remoting is disabled on the guest VM! PowerShell Direct also circumvents Windows Firewall. Note that PowerShell Direct requires that commands are sent only from a Hyper-V host to its local VMs.

Also, PowerShell Direct is supported at this point only by Windows Server 2016 TP3 and Windows 10. That means a Windows Server 2016 TP3 Hyper-V host cannot leverage PowerShell Direct against, say, Windows Server 2012 R2 virtual machines (give the Hyper-V, PowerShell, and Windows Server teams time; I'm sure this will be supported in the future).

The secret sauce behind PowerShell Direct is PowerShell Remoting Protocol (MS-PSRP), which used to be called just plain ol' garden variety "PowerShell remoting."

The Lab Setup

In my test lab, I started with a domain controller and Hyper-V host (yeah, I'm combining server roles--what of it?) named hyperv1.company.pri. That server's running Windows Server 2016 Technical Preview 3.

In Hyper-V I created a single virtual switch named Internal that is connected to the host/guest network. Of course, we don't care about the switch fabric because we're going to use PowerShell Direct.

Next, I built a Windows Server 2016 TP3-based guest VM named server1 and disabled the network adapter as you can see in the following screenshot. No smoke and mirrors here!

Our lab is set up and ready to test PowerShell Direct.

Our lab is set up and ready to test PowerShell Direct.

As a final "sanity check" to ensure the guest VM is as theoretically inaccessible as possible, I blocked access to all remote access session configurations and disabled the Windows Remote Management (WinRM) service by running the following command from within the guest (thanks to PowerShell MVP Aleksandar Nikolić for clarification on this point):

Disable-PSRemoting -Force

Get-Service -Name WinRM | Stop-Service -Force | Set-Service -StartupType Disabled

Okay. Let's move onto the next phase of our experiment.

Sending Commands to the Guest VM

Let's obtain the name and globally unique identifier (GUID) of our Windows Server 2016 VM (you'll see why in just a moment):

Get-VM | Select-Object -Property Name, VMid

Name        VMId
----        ----
server1     31d787fe-02cd-4363-b50b-16bc8243fc77

PowerShell Direct makes itself manifest by means of two new parameters:

  • VMname
  • VMGuid

Handy, eh? The following two cmdlets support the -VMname and -VMGuid parameters as of this writing in October 2016:

Time to test! Let's start a remote session with the server1 guest VM by specifying its GUID. Note that you will need:

  • Hyper-V administrative privileges on the host
  • Local administrative privileges on the guest
$cred = Get-Credential
Enter-PSSession -VMGuid 31d787fe-02cd-4363-b50b-16bc8243fc77 -Credential $cred

[server1]: PS C:\Users\Administrator\Documents>

We'll finish by using Invoke-Command to send ad-hoc PowerShell pipelines and entire scripts from host to guest:

Invoke-Command -VMName 'server1' -Credential $cred -ScriptBlock { Get-Service | Where-Object {$_.Status -eq 'Stopped'} }

Invoke-Command -VMName 'server1' -FilePath 'D:\scripts\setup-ip.ps1' -Credential $cred

Conclusions

Convenience is the primary advantage that PowerShell Direct brings to us Hyper-V administrators. We can connect to and fully administer our guest virtual machines regardless of their networking, firewall, or WS-Man state. Thanks for reading, and more power to the shell!

TechSession Webinar: The Top 10 Considerations When Writing #PowerShell Advanced Functions

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's session is: “The Top 10 Considerations When Writing PowerShell Advanced Functions”.

Here’s what you can expect from my presentation:

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.

Registration URL: https://attendee.gotowebinar.com/register/39900545688014338

Who am I?

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 Mississippi PowerShell User Group. He blogs at mikefrobbins.com and can be found on twitter @mikefrobbins.

µ

Skip to toolbar