Mission Possible with Windows PowerShell
In Windows 8.1 the number of tasks you can perform using Windows PowerShell has increased. So, let’s take a look at some of the new, improved, or just plain fun functions you can perform using Windows PowerShell.
Mission 1: Replace Diskpart.exe
In Windows 8, it was possible to use Windows PowerShell as a replacement for DISM.exe, but capturing and applying was missing. This has now been fixed and we can now use the Expand-WindowsImage cmdlet and the Add-WindowsImage cmdlets.
Mission 2: Export and Import the Start screen
Sometimes it is necessary to modify the Start screen. The way to do this in previous versions of Windows was not that easy and that has changed with Windows 8.1. We can now use Export-StartLayout and Import-StartLayout. In this example, I’m importing the Start screen layout directly into the running operating sytem, but it could also be imported into a mounted image, just point –MountPath to the correct drive.
Mission 3: Download and Deploy Windows PowerShell Help
The help in Windows PowerShell is a bit better if you update it, but instead of updating every machine directly from the Internet, you can download the help files to a folder and then import them. This way, it is unnecessary for every person to download their own copy.
Mission 4: Put That Configuration on That PC
One if the coolest new features is Desired State Configuration, which basically means that we can define how a Windows computer should be configured. We can use Desired State Configuration to install an application or a server fully configured as a web server, the possibilities are more or less unlimited. In this example, I need to install RDCMan on a Windows 8.1 computer, but the problem is that I really need to have .NET Framework 3 installed, since that is required for RDCman to be installed and working.
Mission 5: Test Connectivity Not Using Ping.exe
I have been using ping like everyone else, but with Windows PowerShell you can switch over to something a bit more interesting. Using the Test-Connection cmdlet, you can now very easily use the information that gets returned back as a verification. Let’s assume that I would like to test the connectivity to a Microsoft web server. Using ping behind a normal firewall, this would not work. Using Test-Connection; however, will work since I can define how it should test it, in this case, using HTTP:
And the reply back will be:
Mission 6: We Need Kiosk Mode
Kiosk Mode is a new feature in Windows 8.1 and of course there are some nice Windows PowerShell commands available to utilize it. We can assign applications to the user, as well as clear and get the assigned applications. First, we run need to find out what applications the user has currently. This means we need to log on with that account once to get all the application provisioned correctly; this can be done in a task sequence if needed. Then, we assign the application to the user and verify it. Suddenly, it is fun to build the kiosk computer using an automated deployment process to the lobby. :-)
The result after running the command:
There are many other missions you can achieve; these are just a sample. I recommend that you download the latest version of Windows PowerShell (Windows PowerShell 4.0) today and see Scripting with Windows PowerShell for more details.
About the Author
Mikael Nystrom is a Microsoft MVP and Microsoft Certified Trainer (MCT) specializing in deployment, virtualization, and management. He has been involved in Technology Adoption Programs (TAPs) for several Microsoft products and technologies including Windows Server, Hyper-V, Windows 7, and Windows 8. In addition to his work as a speaker, trainer, and consultant, Mikael frequently shares technical news and insights through his blog and on Twitter.