Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Latest posts

All good things must come to an end
Feb 16, 2021
Post comments count 4
Post likes count 18

All good things must come to an end

Doctor Scripto
Doctor Scripto

Introduction of New PowerShell Community Blog and Retirement of "Hey Scripting Guy!" Blog, the passing of the Torch to a new Generation.

Testing RPC ports with PowerShell (and yes, it’s as much fun as it sounds!) New and Improved!!
Jan 31, 2021
Post comments count 2
Post likes count 0

Testing RPC ports with PowerShell (and yes, it’s as much fun as it sounds!) New and Improved!!

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell to identify RPC ports in use by capturing content from PowerShell We'd like to introduce you today to one of our newest bloggers!  It's a froopingly awesome friend of ours, Joel Vickery, PFE.  (did I mention Dr. Scripto is a big fan of books written by Douglas Adams?....oops!) Take it away Joel! Thanks Doc!  So hey everybody! What do you do when you have to troubleshoot the dreaded "RPC Unavailable" error 1722, which rears its ugly head anywhere from Active Directory replication to Configuration Manager Distribution Point installations, and many other places in between? We have the ans...

Import Azure DevOps Test Plans from One Environment to Another
Sep 9, 2020
Post comments count 0
Post likes count 2

Import Azure DevOps Test Plans from One Environment to Another

Claudia Ferguson
Claudia Ferguson

Summary Standardization of Azure DevOps Test Plans and Reusing Them Between Different Organizations Today we introduce Claudia Ferguson and Mike Stiers to the Scripting Blog. Claudia is a Senior Consultant with the Microsoft Active Directory Migration Services Engineer team, and Mike Stiers is a Microsoft Consultant from Toronto Canada. His focus is to help teams to use scalable infrastructure as code deployments in Azure DevOps. They put together something you will find to be very useful when you need to move DevOps test plans. There is some PowerShell here too (as it's the Scripting Blog!) but the content is...

Just go with the flow…. WorkFlow that is with Windows PowerShell
Dec 18, 2019
Post comments count 6
Post likes count 0

Just go with the flow…. WorkFlow that is with Windows PowerShell

Doctor Scripto
Doctor Scripto

Doctor Scripto returns again with our good friend Joel Vickery, PFE who is going to touch on the use of Workflows In PowerShell. Take it away Joel! Following up on my original post Parallel Processing with jobs in PowerShell, I wanted to go into another method of running parallel processes in PowerShell, namely WorkFlows. WorkFlow is very similar to using the Start-Job/-asJob functionality but it has some distinct advantages that are fully covered in many other blog postings on TechNet.  I'll mention them quickly below, but if you want deeper detail, see the When Windows PowerShell Met WorkFlow blog posting...

PowerTip: Identify Completed PowerShell Jobs with Data yet to be Received
Dec 11, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify Completed PowerShell Jobs with Data yet to be Received

Doctor Scripto
Doctor Scripto

Summary: Doctor Scripto quickly shows how to identify Completed Jobs in PowerShell which have yet to have the data Received Hey Doctor Scripto, How can I identify jobs which already completed but I haven’t done a Receive-Job on to get the data? You can do this with the Get-Job Cmdlet by targeting the -ChildJobState and -HasMoreData like the following example Get-Job -ChildJobState Completed -HasMoreData:$True PowerShell, Doctor Scripto, PowerTip, Sean Kearney

Parallel Processing with jobs in PowerShell
Dec 11, 2019
Post comments count 3
Post likes count 0

Parallel Processing with jobs in PowerShell

Doctor Scripto
Doctor Scripto

Joel Vickery discusses an introductory use of PowerShell jobs and working with data

PowerTip: Use Windows PowerShell to display all Environment variables
Nov 13, 2019
Post comments count 3
Post likes count 2

PowerTip: Use Windows PowerShell to display all Environment variables

Doctor Scripto
Doctor Scripto

Summary: Doctor Scripto demonstrates how to use env: to show all currently set environment variables Question: Hey Doctor Scripto, I remember in DOS if I wanted to see the values of all the Environment variables; like TEMP I could just type the SET Command. How do I do this in PowerShell? Answer: You can do this in one line using the env: PowerShell drive to display all of the currently set Environment variables. dir env: PowerShell, Doctor Scripto, PowerTip, Sean Kearney  

PowerTip: Identify if CredentialGuard is enabled with Windows PowerShell
Oct 30, 2019
Post comments count 3
Post likes count 0

PowerTip: Identify if CredentialGuard is enabled with Windows PowerShell

Doctor Scripto
Doctor Scripto

Summary: Easily identify if Credential Guard is enabled using the Get-ComputerInfo Cmdlet in Windows 10 Question: Hey Doctor Scripto, how can I tell if CredentialGuard has been enabled on my Windows 10 computer? Answer: Just use the Get-ComputerInfo Cmdlet and target the DeviceGaurdSecurityServicesConfigured property. The following line will produce a Boolean $TRUE if it is enabled. 'CredentialGuard' -match ((Get-ComputerInfo).DeviceGuardSecurityServicesConfigured) PowerShell, Doctor Scripto, PowerTip, Credential Guard, Paul Greeley  

Use PowerShell to Identify Unassociated Azure Resources
Oct 30, 2019
Post comments count 2
Post likes count 0

Use PowerShell to Identify Unassociated Azure Resources

Doctor Scripto
Doctor Scripto

Summary: Save costs by Identifying Unassociated Resources left behind after deletions in Azure Q: Hey, Scripting Guy! How can I quickly identify un-associated resources in my Azure subscription? A: Hi SH! At least you know that’s a question to ask! I myself when I first began exploring this new world didn’t realize that when deleting a virtual system in Azure, not all the associated resources are deleted with it! First things first, if you’ve never done it, you’ll need to install the Azure PowerShell modules. This can be done by following the steps provided here on docs.microsoft.com Install the...

PowerTip: Using Set-ADUser with multi-valued attributes
Oct 23, 2019
Post comments count 1
Post likes count 1

PowerTip: Using Set-ADUser with multi-valued attributes

Doctor Scripto
Doctor Scripto

Summary: Using the -Replace parameter with Set-ADUser to take an array to populate multi-valued attributes Question: Hey Doctor Scripto, how can I use Set-ADUser to populate multivalued attributes in Active Directory? Answer: You can use an array with the -Replace parameter to do it. Set-ADUser -Identity "TestUser" -Replace @{ProxyAddresses = @("Address1","Address2","Address3")} PowerShell, Doctor Scripto, PowerTip, Active Directory, Walid Moselhy  

Copy multi-valued Active Directory attributes from one user to another with PowerShell
Oct 23, 2019
Post comments count 1
Post likes count 0

Copy multi-valued Active Directory attributes from one user to another with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using -Replace parameter with Set-ADUser to copy Active Directory multi-valued attributes Q: Hey, Doctor Scripto! We are in the middle of an Active Directory migration and need to copy the multi-valued attribute “ProxyAddresses” from old user accounts to new ones. Can you do with a few lines of code? —ND A: Hello ND, Hello everyone, your good friend Doctor Scripto is here with Walid, one of our PFEs who really likes mixing PowerShell with Active Directory. Walid, what do you think of this one? Well, Doctor Scripto, it makes a lot of sense to try and automate this type of tasks. Who like...

PowerTip: Use New-Alias to make Cmdlets easier to remember
Oct 16, 2019
Post comments count 0
Post likes count 0

PowerTip: Use New-Alias to make Cmdlets easier to remember

Doctor Scripto
Doctor Scripto

Using New-Alias to create easier to remember shortcuts in PowerShell

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 4
Oct 16, 2019
Post comments count 0
Post likes count 0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 4

Doctor Scripto
Doctor Scripto

Summary: Using Windows PowerShell to purge Wlan profiles with NetSh.exe. Last week we had a way with a Regular Expression to run one Netsh.exe command and show only the profile names as a PowerShell Array. Today we're going to finish the task and show you how to delete those Profiles. As a quick reminder here's the line in PowerShell we used to capture the list of Wireless profiles by only their names as an Array. The resulting output containing our Wireless profile names looked like this From our first posting we saw that to delete a WLAN profile in Netsh.exe we would execute this command. ...

PowerTip: Show all Installed Capabilities on Windows 10
Oct 9, 2019
Post comments count 0
Post likes count 0

PowerTip: Show all Installed Capabilities on Windows 10

Doctor Scripto
Doctor Scripto

Summary: Identify if capabilities like OpenSSH are installed in your Windows 10 Operating System Hey, Doctor Scripto. I was curious if there was a way to see if a workstation has a capability installed on it like OpenSSH. I’m trying to report on this for my environment. Absolutely! You can run the following line on a workstation to show the installed Capabilities like OpenSSH Get-WindowsCapability -Online | Where-Object { $_.State -eq 'Installed' } PowerShell, Doctor Scripto, PowerTip, Sean Kearney

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 3
Oct 9, 2019
Post comments count 0
Post likes count 0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 3

Doctor Scripto
Doctor Scripto

Summary: Using Regular Expressions to cleanup string data from NetSh.exe. Let's remember the last two discussions. The first time we looked at using PowerShell to identify wireless profiles with some simple regular expressions. We followed up the next week with how to identify which approach would be the fastest. Today we're going to take that array of information and clean it up so we only have the profile names. As a quick reminder here's the line in PowerShell we used to capture the list of Wireless profiles The resulting output looked like this What we need to do now is cleanup this data so...

PowerTip: Identify Drives Encrypted with Bitlocker
Oct 2, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify Drives Encrypted with Bitlocker

Doctor Scripto
Doctor Scripto

Summary: Using the Get-Bitlocker Cmdlet to show the status of drives on your Windows 10 computer Hey, Doctor Scripto. Is there a nice simple way to see if drives are Bitlocker encrypted? A most excellent question! You can the Get-BitlockerVolume Cmdlet and filter on the VolumeStatus property. Here's an example of a line that will show only drives which have Bitlocker enabled. Get-BitLockerVolume | Where-Object { $_.VolumeStatus -eq 'FullyEncrypted' } PowerShell, Doctor Scripto, PowerTip, Sean Kearney  

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 2
Oct 2, 2019
Post comments count 2
Post likes count 0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 2

Doctor Scripto
Doctor Scripto

Summary: Using Measure-Command to determine the fastest approach to a solution. Last week we were having some fun using PowerShell as a wrapper around the NetSh.exe command's output. We were left at a decision point. Which way to go? A For loop to clean up the data, which worked fine or Regular Expressions. Although both work which was the better path to use? For me initially, when I first started in PowerShell I very often used a For loop for a few reasons. But as I progressed in my knowledge of PowerShell I've started to touch on Regular expressions as a solution when possible. A go...

PowerTip: Converting a Here-String to an Array in One Line with PowerShell
Sep 25, 2019
Post comments count 2
Post likes count 0

PowerTip: Converting a Here-String to an Array in One Line with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the split method in a more powerful fashion to split an array based upon two line terminating types Hey, Doctor Scripto. I was wondering if there was a more efficient way of converting a Here-String to an Array when there were multiple line termination options like Linefeed or Carriage Return and Linefeed? There most definitely is. You can pass multiple parameters to the split method. This example traps both! $HereStringSample=@' Banana Raspberry '@ $HereStringSample.Split(@("$([char][byte]10)", "$([char][byte]10)","$([char][byte]13)", [StringSplitOptions]::None)) PowerShe...

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 1
Sep 25, 2019
Post comments count 0
Post likes count 0

Using PowerShell to View and Remove Wireless Profiles in Windows 10 – Part 1

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell and Regular Expressions as a wrapper on NetSh.exe output to identify the profiles. Hey, Doctor Scripto! I have a whole pile of old Wireless profiles that have been collecting dust. I know I can use NETSH to view and delete them, but the process is very manual. Do you know if there is an easier way to clear them up? —WF Hello WF, you asked I shall help. Doctor Scripto is in the house! I know the process you mean, I had to do this a few years ago on one of my old laptops. I had wireless profiles from my home, hotels, offices, coffee shops. It was just silly. I think there we...

PowerTip: Identify which Platform PowerShell is running on
Sep 18, 2019
Post comments count 1
Post likes count 0

PowerTip: Identify which Platform PowerShell is running on

Doctor Scripto
Doctor Scripto

Summary: Using $PSVersionTable to identify if you are on Windows or Unix Hey, Doctor Scripto! I'm working on my PowerShell scripts and I need to be able to identify if I'm working on Windows or Linux. How can I do this easily? No problem at all and glad to help. Just examine the $PSVersionTable property called Platform. It will contain one either 'Unix','Win32NT' on PowerShell Core. In the case of Windows PowerShell it will not exist. $PSVersionTable.Platform PowerShell, Doctor Scripto, PowerTip, Sean Kearney  

Creating a Platform Independent Function in PowerShell
Sep 18, 2019
Post comments count 1
Post likes count 0

Creating a Platform Independent Function in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Creating a Function in PowerShell and the power of the $PSVersionTable to make code more portable Q: Hey, Doctor Scripto! I saw that post last week on converting Here-String into an array. I wanted to write my code to trap for PowerShell and PowerShell Core. Could you give me a helping hand? —PG A: Hello PG, Hello everyone, your good friend Doctor Scripto is here with Sean sitting across from me having lunch. Sean what do you think about this idea? Well Doctor Scripto this is actually pretty easy and it makes a LOT of sense to have a function do this to avoid re-writing the same code. ...

PowerTip: Identify if you are running on PowerShell Core
Sep 11, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify if you are running on PowerShell Core

Doctor Scripto
Doctor Scripto

Summary: Pulling up the properties of $PSVersionTable to identify your PowerShell edition Hey, Doctor Scripto! I want to write my modules and scripts to be more portable. How can I tell if I am executing on PowerShell Core? Just use the $PSVersionTable object and examine the PSEdition value. If it returns 'Core' you are running on PowerShell core. $PSVersionTable.PSEdition PowerShell, Doctor Scripto, PowerTip, Sean Kearney  

Maximizing the Power of Here-String in PowerShell for Configuration Data
Sep 11, 2019
Post comments count 3
Post likes count 0

Maximizing the Power of Here-String in PowerShell for Configuration Data

Doctor Scripto
Doctor Scripto

Summary: Discovering some of the awesome and neat ways to leverage a Here-String in a Script or function Q: Hey, Doctor Scripto! I used to write scripts with supporting configuration files that never really changed. I was wondering if there was any way to put them INSIDE the script directly to make it self contained. —AB A: Hello AB, I was chatting with my good friend Sean on this one. Here he talks about using Here-Strings to solve this problem. Thanks Doctor Scripto, yes a Here-String can be a great way to embed the configuration or other data for that matter in a script. If you've never encou...

PowerTip: Read a JSON configuration file as a PowerShell object
Sep 4, 2019
Post comments count 0
Post likes count 1

PowerTip: Read a JSON configuration file as a PowerShell object

Doctor Scripto
Doctor Scripto

Summary: Using the ConvertFrom-Json Cmdlet in PowerShell to read a JSON formatted file Hey, Doctor Scripto! I've seen a lot of JSON files in use in Azure. I'm not very good with editing JSON properly. Is there an easy way to read this and at least edit it with PowerShell? Most definitely my good friend. For the file below called "settings.json" you can convert it to a PowerShell Object for editing purposes using the following line.   Once you have completed this, you can manipulate it like any other PowerShell Object. $PowerShellObject=Get-Content -Path settings.json | ConvertFrom-Json Pow...

Configuring Startup Settings in Microsoft Teams with Windows PowerShell
Sep 4, 2019
Post comments count 2
Post likes count 0

Configuring Startup Settings in Microsoft Teams with Windows PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the ConvertFrom-JSON and ConvertTo-JSON Cmdlets to edit a configuration file Q: Hey, Doctor Scripto! I need to be able to change the Startup settings in Teams (like the Auto launch feature). I can change it in the Interface, but I need to be able to edit across multiple systems. Could you lend me a hand? —RL A: Hello RL, A very excellent question. For which it produced a most interesting solution when I asked Sean Kearney one of our Microsoft PFE's to look at it. Take it away Sean! Let's begin by examining the settings we are trying to change. They can be accessed under the "Setti...

PowerTip: Using PowerShell to Convert raw Text to a Comma Separated columm
Aug 28, 2019
Post comments count 0
Post likes count 0

PowerTip: Using PowerShell to Convert raw Text to a Comma Separated columm

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell and a very simple Regular Expression to convert Random counts of spaces to a Comma Hey Doctor Scripto! I have some string based output from a non PowerShell application. The output is good but I need to easily parse it. Is there a way to convert that data to something consistent like "Comma Separated?" Why yes you can! This is something that is easily done with a regular expression. Using a simple example like this will identify all content with more than one blank space separating it, and replace it with a comma! $SampleText='Hello             This                      ...

Automating Quser through PowerShell
Aug 27, 2019
Post comments count 0
Post likes count 0

Automating Quser through PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell to automate Quser to identify users to Logoff systems in Windows Hey Doctor Scripto! I need to log a user off every computer they’re logged into. The problem is, I don’t know which ones. How can I discover which computers they’re logged into and then log them off? That's a most excellent question!  I know just the person who can answer that.   I was talking my good friend Dan Reist on this topic.   Dan is a Senior Consultant on Data Platforms here at Microsoft.   He actually ran into that same issue. Dan, the room is yours today, take it away! Thanks Doctor Scripto! So my ...

PowerTip: Identify if SQL Servers are configured to best practices
Aug 21, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify if SQL Servers are configured to best practices

Doctor Scripto
Doctor Scripto

Summary: Using the features of the SQLServer PowerShell module to run assessments of your servers How can I easily check that my SQL Servers are all configured to meet best practices? You can use SQL Server Assessments – the latest addition to the SQLServer PowerShell module. Just Run a best practices assessment on your SQL Server as seen below Get-SqlInstance  "DemoSQLServer" | Invoke-SqlAssessment PowerShell, Doctor Scripto, PowerTip, Johnathan Allen, SQL Server  

Executing SQL Server Assessments from PowerShell
Aug 21, 2019
Post comments count 0
Post likes count 0

Executing SQL Server Assessments from PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the SQLServer module cmdlets to review and monitor SQL Server instance and database configuration Q: Hey, Doctor Scripto! I have loads of SQL Servers in my area of responsibility and I know they all need certain configuration settings but I'm never confident that they are all set just right so I spend a long time every month visiting them all over RDP to give reassure myself. How can I automate this work? —AB A: Hello AB, I know the very person that can answer that question for you. It's my good friend Jonathan Allen. Let me introduce him to you. He's a SQL Server PFE from the UK. He...

PowerTip: Identify Synchronized AzureAD accounts without a License assigned
Aug 14, 2019
Post comments count 4
Post likes count 0

PowerTip: Identify Synchronized AzureAD accounts without a License assigned

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell to identify users who are Synchronized to AzureAD but not yet licensed Hey, Doctor Scripto! I'd love to be able to identify users Synchronized to AzureAD that haven't yet had their licenses assigned.   Help a friend out? No problem at all!  You can target that information with two parameters in the Get-Msoluser Cmdlet! Get-MsolUser -UnlicensedUsersOnly -Synchronized PowerShell, Doctor Scripto, PowerTip, AzureAD  

Reporting on Microsoft 365 Licensing using PowerShell – Part 3
Aug 14, 2019
Post comments count 1
Post likes count 0

Reporting on Microsoft 365 Licensing using PowerShell – Part 3

Doctor Scripto
Doctor Scripto

Summary: Will Martin finalizes his discussion on how to report on Microsoft 365 licensing in the cloud. Previous Posts on this article can be found here for continuity Reporting on Microsoft 365 Licensing using PowerShell – Part 1 Reporting on Microsoft 365 Licensing using PowerShell – Part 2 Dr. Scripto here! When last we saw Will Martin, he was deep in a script pulling down licensing tables and produced a lovely hash table. Let’s watch for the exciting conclusion! From last week, we placed our data in a hash table. Now, let’s swap it from a hash table to CSV format by changing our last active lin...

PowerTip: Identify the last time Users changed passwords in AzureAD
Aug 7, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify the last time Users changed passwords in AzureAD

Doctor Scripto
Doctor Scripto

Summary: Using PowerShell to report on Users and the last time Passwords were changed Hey, Doctor Scripto! I need to report on users and when they updated their passwords In AzureAD. Could you show me how ? Most certainly, I love to provide a helping hand however I can. Using the Get-Msoluser Cmdlet just target the LastPasswordChangeTimeStamp Attribute. Here's an example of it in use. Get-MsolUser | Select-Object DisplayName, UserPrincipalName, LastPasswordChangeTimeStamp PowerShell, Doctor Scripto, PowerTip, AzureAD  

Reporting on Microsoft 365 Licensing using PowerShell – Part 2
Aug 7, 2019
Post comments count 0
Post likes count 0

Reporting on Microsoft 365 Licensing using PowerShell – Part 2

Doctor Scripto
Doctor Scripto

Summary: Will Martin continues his discussion on how to report on Microsoft 365 licensing in the cloud. Previous Posts on this article can be found here for continuity Reporting on Microsoft 365 Licensing using PowerShell – Part 1 Remember from last week we showed the results of what a user licensed in Microsoft 365 looked like in the web portal? So, what does this look like if we try to access it in PowerShell? Well, we have the user, and the service plan. Can we get this into a usable format? Well, let’s see what we can do – let’s try pulling this info for our last three users and see what we...

PowerTip: Identify the last time a User was Synchronized to AzureAD
Jul 31, 2019
Post comments count 0
Post likes count 0

PowerTip: Identify the last time a User was Synchronized to AzureAD

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to identify the property in AzureAD with the Synchronization time in AzureAD Hey, Doctor Scripto. Is there a way with PowerShell to identify when a user was last synchronized with AzureAD? Absolutely! We just need to examine the LastDirSyncTime when using the Get-Msoluser cmdlet. Here’s an example below (Get-MsolUser -UserPrincipalName 'drscripto@contoso.com').LastDirSyncTime PowerShell, Doctor Scripto, PowerTip, Microsoft 365    

Reporting on Microsoft 365 Licensing using PowerShell – Part 1
Jul 31, 2019
Post comments count 0
Post likes count 0

Reporting on Microsoft 365 Licensing using PowerShell – Part 1

Doctor Scripto
Doctor Scripto

Summary: Will Martin discusses how to report on Microsoft 365 licensing in the cloud. Hello everyone, Doctor Scripto here today to introduce you to a good friend of mine. Will Martin is a PFE in Messaging here at Microsoft and he wanted to share a wonderful solution he found on reporting on Microsoft 365 licensing with PowerShell. Will my friend, the Blog is now in your most capable hands! Thanks for the introduction Doctor Scripto! I came across an interesting problem recently. I was asked by my large Office 365 customer if I could give them a script that would output all their user account licensing...

PowerTip: Show files with expired Digital Certificates
Jul 24, 2019
Post comments count 0
Post likes count 0

PowerTip: Show files with expired Digital Certificates

Doctor Scripto
Doctor Scripto

Summary: Targeting Expired Certificates with Get-AuthenticodeSignature Question: Hey Doctor Scripto! Is there an easy way to visually identify Digitally signed files with an Expired status on the Digital Certificate? Answer: Absolutely! We just need to filter on the “Status” property and show those without the value ‘Valid’. As an added bonus it would also identify files that are not digitally signed. Get-Childitem C:\Folder\*.* -Recurse | Get-AuthenticodeSignature | Where-Object { $_.Status -ne 'Valid' } PowerShell, Doctor Scripto, PowerTip  

Reporting on Digitally Signed Files with PowerShell
Jul 24, 2019
Post comments count 1
Post likes count 0

Reporting on Digitally Signed Files with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the Get-AuthenticodeSignature cmdlet to show if a file is Digitally Signed Q: Hey, Doctor Scripto! I was curious, since many new files are Digitally signed with a certificate if there was an easy way to see the status of the Digital Signatures of many files easily? —SH A: Hello SH your good friend Doctor Scripto is here today to help you along. One of the things which changed with PowerShell in version 3.0 was a beautiful little Cmdlet called Get-AuthenticodeSignature This Cmdlets task was very simple, examine a file and show the properties of the Digital Certificate on a file. He...

Clean up Domain Controller DNS Records with Powershell
Jul 17, 2019
Post comments count 1
Post likes count 3

Clean up Domain Controller DNS Records with Powershell

Doctor Scripto
Doctor Scripto

Summary: Using Windows PowerShell to remove Stale / Dead Domain Controller records. Q: Hey, Doctor Scripto! How can I quickly clean up all my dead Domain Controller’s DNS records? A: That’s a great question. The good Doctor also knows the very person to answer it best. My good friend Patrick Mercier, An Active Directory PFE who loves working with PowerShell. Take it away Patrick! Whether it’s as part of Active Directory Disaster Recovery, or because you had an old Domain Controller you needed to get rid of, cleaning up all the DNS records of a now dead DC left behind can be tedious: that is, unl...

PowerShell PowerTip: Customizing your prompt
Nov 13, 2018
Post comments count 0
Post likes count 1

PowerShell PowerTip: Customizing your prompt

Kory Thacher
Kory Thacher

I've been taking a break from the blog for a while due to some personal reasons, but I had a few people ask me about my PowerShell prompt recently. I like extra horizontal space, so I removed the path from the prompt and put it in the window title bar. I also just display the current time in the prompt itself. You can customize your prompt by using your profile and overriding the "Prompt" function. A coworker of mine, Tony Radkiewicz, used a similar prompt and I really liked it so I've been using it since. That's all for now, I'll try to get some...

PowerTip: Use PowerShell to pick a random name from a list
Sep 15, 2018
Post comments count 2
Post likes count 0

PowerTip: Use PowerShell to pick a random name from a list

Doctor Scripto
Doctor Scripto

Using the Get-Random Cmdlet to select a random list of names instead of numbers

Using PowerShell to create a folder of Demo data
Sep 15, 2018
Post comments count 2
Post likes count 2

Using PowerShell to create a folder of Demo data

Doctor Scripto
Doctor Scripto

Creating sample files with random sizes and dates for use in a Lab

PowerShell PowerTip: searching and installing modules on the command line
Aug 21, 2018
Post comments count 0
Post likes count 1

PowerShell PowerTip: searching and installing modules on the command line

Kory Thacher
Kory Thacher

PowerShell 5+ ships with the module PowerShellGet, which lets us search and install modules from cmdlets. The default nuget repository is the PowerShell Gallery, but you could add others yourself (including custom ones for internal modules). There are a lot of reasons this could help you: There are a lot of cmdlets in the module, but the ones you'll use the most will be: You can also specify the scope on install-module and put it in your user module location for ones just for you on a machine. Hope that helps, tune in more often to get short and sweet PowerTips!

Regular Expressions (REGEX): Grouping & [RegEx]
Aug 14, 2018
Post comments count 1
Post likes count 2

Regular Expressions (REGEX): Grouping & [RegEx]

Kory Thacher
Kory Thacher

Welcome back to the RegEx crash course. Last time we talked about the basic symbols we plan to use as our foundation. This week, we will be learning a new way to leverage our patterns for data extraction and how to rip our extracted data into pieces we care about. [RegEx] The  data type has some cool static members,  but we're mostly going to play with the plural method  if you don't know what static members are you can check this post or this help data. A lot of the time, when we work with RegEx we are using it to extract everything that matches our pattern in a large amount of data. Using  like we did in t...

PowerShell PowerTip: History of commands with PSReadline
Aug 7, 2018
Post comments count 0
Post likes count 0

PowerShell PowerTip: History of commands with PSReadline

Kory Thacher
Kory Thacher

One of the really cool things PSReadline provides (module shipping on v5+) isn't as immediately obvious as the syntax highlighting. It offers a persistent history that is stored from session to session. This means if you run commands in a window, close it, and open a new one later you can still hit the up arrow and scroll through them. I use this feature quite a bit doing demos or just working on things where I want to clear out my whole scope and jump back in. If you want to opt out you can as well: Hope that helps, tune in more often to get short and sweet PowerTips!

Regular Expressions (REGEX): Basic symbols
Jul 31, 2018
Post comments count 0
Post likes count 2

Regular Expressions (REGEX): Basic symbols

Kory Thacher
Kory Thacher

Welcome back to the RegEx guide. Last post we talked a little bit about the basics of RegEx and its uses. I mentioned the most important thing is to understand the symbols. Today we'll ease in with some of the basics to get us going, but later we will expand on these and see some other options we have.  is used to represent any single character, aside from a newline, so it will feel very similar to the windows wildcard  is the escape character for RegEx, the escape character has two jobs: We can use  to specify quantity in a few different ways by attaching them to characters or symbols. ...

PowerShell PowerTip: What is the point of Out-Variable?
Jul 24, 2018
Post comments count 0
Post likes count 2

PowerShell PowerTip: What is the point of Out-Variable?

Kory Thacher
Kory Thacher

A lot of times people see others using the common parameter -OutVariable instead of the best practice $var = <value>. This leads to a lot of folks wondering why OutVariable  exists. The real use for OutVariable is to save your data off, while still letting it get sent along the output stream. What this means is that you could use it somewhere inside of a pipe to save some data for later re-use, but continue doing other work with that data. Notice that even though the data continued being pipped along, I could also reference it later when I asked for the count. Hope that helps, tune in more ...

PowerTip: Turn off the power to your computer with PowerShell
Jul 16, 2018
Post comments count 1
Post likes count 0

PowerTip: Turn off the power to your computer with PowerShell

Doctor Scripto
Doctor Scripto

I’ve got a script that needs to power off a system after it’s done. How can I accomplish this with PowerShell?

Parse HTML and pass to Cognitive Services Text-to-Speech
Jul 16, 2018
Post comments count 0
Post likes count 0

Parse HTML and pass to Cognitive Services Text-to-Speech

Doctor Scripto
Doctor Scripto

Having some fun with Abbott and Costello’s “Who’s on first?” comedy routine, and multiple voices with Bing Speech.

PowerShell PowerTip: What you should know about streams
Jul 10, 2018
Post comments count 0
Post likes count 0

PowerShell PowerTip: What you should know about streams

Kory Thacher
Kory Thacher

PowerShell has a concept called Streams, which are the different places data can go (output, error, verbose, etc). You usually don't have to worry too much about these streams if you're just writing simple scripts, but it helps a ton to know: What this means for you, as users, is that you can get a non-terminating error, and still do work on the successful output. Take a look at this: Notice that even though I received an error for the process "FAKE", only the non-errors were present in $procs. Using some basic error handling we could clean that up, hide the error message and log out wha...

Regular Expressions (REGEX): Introduction
Jul 5, 2018
Post comments count 0
Post likes count 0

Regular Expressions (REGEX): Introduction

Kory Thacher
Kory Thacher

Hi all, this week I'll be talking about Regular Expressions. I've got a few posts planned to get you set up and going with some basic Regex. Regex is used for extracting and validating data. Essentially, you can think of Regex as windows wild cards on steroids. Anytime we need to match data with a little more clarity than the *s and ?s that windows gives us, we have Regex. Regex has a reputation for being difficult and confusing, but it really isn't so bad when you get used to it. The biggest contributors to Regex's reputation are: With that in mind, let's take a look at a sample about why you ...

PowerTip: Determine your version of PowerShell and host operating system
Jun 29, 2018
Post comments count 0
Post likes count 0

PowerTip: Determine your version of PowerShell and host operating system

Doctor Scripto
Doctor Scripto

Identify your PowerShell environment by making use of built-in PowerShell variables.

Windows PowerShell and the Text-to-Speech REST API (Part 5)
Jun 29, 2018
Post comments count 0
Post likes count 0

Windows PowerShell and the Text-to-Speech REST API (Part 5)

Doctor Scripto
Doctor Scripto

Send and receive content to the Text-to-Speech API with PowerShell.

PowerShell PowerTip: Checking your PowerShell version
Jun 26, 2018
Post comments count 0
Post likes count 0

PowerShell PowerTip: Checking your PowerShell version

Kory Thacher
Kory Thacher

If there is one question I could say I get the most in PowerShell, it is: How do I check my version? Its not a hard thing, but its not an obvious thing. We can actually check our version with a build in variable called PSVersionTable Hope that helps, tune in more often to get short and sweet PowerTips!

PowerShell For Programmers: Here Strings, There Strings, Everywhere Some String Strings
Jun 19, 2018
Post comments count 0
Post likes count 0

PowerShell For Programmers: Here Strings, There Strings, Everywhere Some String Strings

Kory Thacher
Kory Thacher

There won't be much code in today's post, but this can be a useful feature to know about. In addition to the expandable and literal strings we talked about, we can also use something called a Here String. Here strings allow us to have quote characters inside of our string that match the quote characters we use to create that string. For example, you might want the double quote character to appear inside of your expandable-string. You could use the escape character on the internal quote to prevent it from closing your string, but if you had a massive amount of quotes this would be annoying. Here strings exis...

PowerTip: Use PowerShell to play WAV files
Jun 15, 2018
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to play WAV files

Doctor Scripto
Doctor Scripto

Make use of the native features of Windows through PowerShell to play sound.

Windows PowerShell and the Text-to-Speech REST API (Part 4)
Jun 15, 2018
Post comments count 0
Post likes count 0

Windows PowerShell and the Text-to-Speech REST API (Part 4)

Doctor Scripto
Doctor Scripto

Send and receive content to the Text-to-Speech API with PowerShell.

PowerShell PowerTip: Grabbing the location your script lives in
Jun 12, 2018
Post comments count 0
Post likes count 0

PowerShell PowerTip: Grabbing the location your script lives in

Kory Thacher
Kory Thacher

One super common thing in PowerShell is to design a script to consume particular files for data. Often times you are building the script right in the folder for your files. However, it can be annoying to give long, literal file paths to a file. Also, if you give that script to someone else, they need to edit that path to point at the right location-- how annoying! There is a built in variable to help with this scenario: $PSScriptRoot will provide the file path the script was run from, which can let you relatively point at files. You can see an example of this in an older blog post. I received a few questions ab...

Working with JSON data in PowerShell
Jun 5, 2018
Post comments count 1
Post likes count 7

Working with JSON data in PowerShell

Kory Thacher
Kory Thacher

Welcome back everyone! This week we will take another look at some common data types we might encounter in the real world: JSON data. JSON data is used pretty frequently on the web if you're hitting APIs. This not only includes external data (twitter, weather, marvel database), but often includes internal data to your company. It's nice to be able to leverage data from anywhere, and it can be frustrating for people to try to parse JSON data. Luckily, we have this all built in for you using ConvertFrom-JSON I'll get a response from an API online used for testing: The response data looks like this: A...

PowerTip: Ensure that errors in PowerShell are caught
May 31, 2018
Post comments count 0
Post likes count 1

PowerTip: Ensure that errors in PowerShell are caught

Doctor Scripto
Doctor Scripto

Here’s how to make sure your errors get caught with <strong>Try Catch Finally</strong>.

Windows PowerShell and the Text-to-Speech REST API (Part 3)
May 31, 2018
Post comments count 0
Post likes count 0

Windows PowerShell and the Text-to-Speech REST API (Part 3)

Doctor Scripto
Doctor Scripto

Use Windows PowerShell to access the Cognitive Services Text-to-Speech API.

PowerShell PowerTip: ISE crashing and auto complete not working
May 30, 2018
Post comments count 0
Post likes count 0

PowerShell PowerTip: ISE crashing and auto complete not working

Kory Thacher
Kory Thacher

Hi all, I'm going to start putting out these short PowerShell PowerTips every so often. They won't be full blog posts, but they will be short and useful! Have you been having issues with the ISE crashing and not auto completing since windows update 1803? From what I've seen there is a fix for this coming, but if you need these features now you can try the 2016 ISE preview To try it run as an admin and do this: Then go ahead and pin it while you wait for the fix. You can also check out VS Code Happy PowerShelling!

Run PowerShell code in Puppet
May 23, 2018
Post comments count 0
Post likes count 0

Run PowerShell code in Puppet

Doctor Scripto
Doctor Scripto

Normally, it’s preferable to use specific Puppet and DSC Windows modules to manage systems in Puppet, but an alternative is running PowerShell commands and scripts by using the <strong>exec</strong> resource. This can be helpful for transitioning existing PowerShell code into Puppet quickly.

Doing more with functions: Verbose logging, Risk mitigation, and Parameter Sets
May 15, 2018
Post comments count 0
Post likes count 1

Doing more with functions: Verbose logging, Risk mitigation, and Parameter Sets

Kory Thacher
Kory Thacher

Welcome back to PowerShell for Programmers, this week I'm trying gitGist again for the code blocks. Let me know what you think about it vs the normal syntax highlighter I use :) As we've seen in the other posts about functions, attributes are a really cool thing to extend the features we have available to ourselves and for our users. This post is going to deal with an attribute for the function itself as well as ones for the individual parameters. This will let us make our functions behave more like any other cmdlet, by giving us access to the common parameters that users are used to seeing. Common Parameters...

PowerTip: Get all your local certificates by using PowerShell
May 9, 2018
Post comments count 0
Post likes count 0

PowerTip: Get all your local certificates by using PowerShell

Doctor Scripto
Doctor Scripto

How can I use Windows PowerShell to enumerate all certificates on my Windows computer?

Get certificate info into a CSV by using PowerShell
May 9, 2018
Post comments count 3
Post likes count 0

Get certificate info into a CSV by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Certificate management is always challenging. Let’s explore how to use PowerShell to export local certificate information to a comma-separated values (CSV) file on Windows 7 (or later) computers. Q: Hey, Scripting Guy! How can I get all my certificate info into a CSV on my Windows computers? —SH A: Hello SH, Patrick Mercier here, with my first “Hey, Scripting Guy!” post. This question has come up at multiple customer sites, as they plan a new PKI infrastructure or a revamp of their current one! There’s tons of resources on using PowerShell for querying certificates, but questions around finding exp...

Grabbing Excel (XLSX) values with PowerShell
May 8, 2018
Post comments count 0
Post likes count 1

Grabbing Excel (XLSX) values with PowerShell

Kory Thacher
Kory Thacher

The Goal: Import data from XLSX files conveniently like import-csv lets you do with simpler data. The preamble: Excel is a mainstay of the business world at this point, which means a lot of the data you might have to work with will come at you as an XLSX file or need to be one. This can be a bit annoying when scripting. If we're just working in PowerShell-land and we can choose to use simple CSV data we have the handy import-csv and export-csv cmdlets, and those CSV files can open up in excel just fine. However, when we are forced to work with XLSX files it can lead to headaches. If you search around ...

Doing More With Functions: Comment-Based Help
Apr 24, 2018
Post comments count 0
Post likes count 0

Doing More With Functions: Comment-Based Help

Kory Thacher
Kory Thacher

I just wanted to throw together a post highlighting how cool and easy it is to add help data to your own Functions and scripts. The help data gets added via comments. For functions the help data can go in three places: For scripts we just put it at the top of your script before you type the param() statement, or at the bottom, but the bottom will mess with code signing. Syntax just involves using a dot before the help keyword and then typing the help you want for it on the next line: Here is a list of all the keywords I found and short descriptions of them: For the most part, I recomm...

Inserting new elements into XML files
Apr 10, 2018
Post comments count 0
Post likes count 0

Inserting new elements into XML files

Kory Thacher
Kory Thacher

The Goal: Insert nodes into a specific place in XML config files The Motivation: I had a coworker a while back working with App Fabric. He needed to insert a particular chunk of XML into a specific spot inside of the config file. This had to be done on a bunch of different machines, but the kicker was that the config files might look different on all of them. We knew the node that needed to come before our new node, but that might be in a different spot in each file. When the configSections node ended ( </configSections> ) we needed to insert: This is the perfect place for PowerShell auto...

Introducing the DscLcm utility for PowerShell
Mar 30, 2018
Post comments count 0
Post likes count 0

Introducing the DscLcm utility for PowerShell

Doctor Scripto
Doctor Scripto

Summary: Desired State Configuration is a great deployment tool to meet your organization’s infrastructure-as-code goals. I recently came across a situation for a project that uses the Push Service (as opposed to the Pull Service). It required me to be able to apply a new partial configuration to a node, without any knowledge of what partial configurations were already in place. This led to the development of the DscLcm module, which solved that problem for my team. DscLcm module The DscLcm PowerShell module is a utility that interacts with the Local Configuration Manager (LCM) of a target machine. You don’t have...

Doing More With Functions: Taking Parameters on the Pipe
Mar 27, 2018
Post comments count 0
Post likes count 1

Doing More With Functions: Taking Parameters on the Pipe

Kory Thacher
Kory Thacher

In an earlier post, I showed you how you could use the [parameter(mandatory)] attribute to force your parameters to behave  a bit more like you'd expect from other languages. We also have a bunch of other useful attributes we can use on our parameters to enable cool features. Pipelineing The pipe might feel pretty magical to you in PowerShell, as it just seems to work with our built in cmdlets. You can add this same kind of functionality to your own tools, and we give you two options to do so. First of all, here is what happens if you don't use this attribute: Pipeline By Value When we talk about stuff...

PowerTip: Build simple HTML with PowerShell
Mar 15, 2018
Post comments count 0
Post likes count 0

PowerTip: Build simple HTML with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Here’s how to use the ConvertTo-HTML cmdlet to build basic HTML content.   Hey, Scripting Guy! Occasionally I need to build basic HTML documents. I heard there was a way to do that with Windows PowerShell.   There most certainly is! Just use the ConvertTo-HTML cmdlet to save the day! For example:                           $SampleDoc=@'                           This is a simple text Document in PowerShell                           That I am going to make into a Tiny web page                           :)                           '@                           ConvertTo-Html -InputObject $SampleDoc      ...

Windows PowerShell and the Text-to-Speech REST API (Part 2)
Mar 15, 2018
Post comments count 0
Post likes count 0

Windows PowerShell and the Text-to-Speech REST API (Part 2)

Doctor Scripto
Doctor Scripto

Summary: You can use Windows PowerShell to authenticate to the Text-to-Speech REST API. Q: Hey, Scripting Guy! I was reading up on the REST API for the Text-to-Speech component of Cognitive Services. I'm just starting to learn how to use REST and PowerShell. Could you spend a little bit of time and show me how to authenticate to the service? —SH A: Hello SH, Authentication is one of the biggest pieces you'll want to learn. Telling a system at the back end who you are, and knowing how to communicate with it, is very critical before you can do anything fun! Talking to the Text-to-Speech API is pretty easy onc...

PowerShell for Programmers: The Magic Switch!
Mar 14, 2018
Post comments count 0
Post likes count 2

PowerShell for Programmers: The Magic Switch!

Kory Thacher
Kory Thacher

Welcome back everyone, I'm trying out GitHub Gist for my code blocks this week. It lets you click and download them, as well as making them easy to edit. The downside is that I can't use my usual dark themed syntax highlighting. Let me know in the comments if you like gist or the old method better :) Switch statements in PowerShell are very cool, and by knowing some of the tricks it has in place it can save you a lot of time. Basic Syntax Let's start by taking a look at a basic switch statement. In C# you might write something like this: In PowerShell you could do this: Notice we don't use t...

PowerShell For Programmers: Strings, Quotes and Quirks
Mar 1, 2018
Post comments count 0
Post likes count 0

PowerShell For Programmers: Strings, Quotes and Quirks

Kory Thacher
Kory Thacher

Welcome back everyone! This will be a short, but important entry for the guide. The difference between quote characters is something I’m asked about all the time. It is important to understand in PowerShell, but most of the time it probably won’t make a difference. TLDR: If you're just typing a value like "alg" then it doesn't matter, but if you have any special symbols you can see the difference. Single vs. Double Quotes We refer to single quotes as Literal Strings and double quotes as Expandable Strings. Both create the same datatype (system.string), but a double quote will expand any special charact...

PowerTip: Create new authentication keys for AzureRM Cognitive Services
Feb 28, 2018
Post comments count 0
Post likes count 0

PowerTip: Create new authentication keys for AzureRM Cognitive Services

Doctor Scripto
Doctor Scripto

Summary: Change the keys to authenticate to Azure RM Cognitive Services, by using Windows PowerShell.   Hey, Scripting Guy! I created the keys for my Rest API. I know I can change them in the web portal, but is there a faster way of doing it through Windows PowerShell?   There absolutely is! Just use the New-AzureRMCognitiveServicesAccountKey cmdlet to reset either Key1 or Key2 (or both). Here is an example, where we generate a new sequence for Key1: New-AzureRMCognitiveServicesAccountKey -ResourceGroup 'HSG' -Name 'Sample' -KeyName Key1

Windows PowerShell and the Azure Text-to-Speech Rest API (Part 1)
Feb 28, 2018
Post comments count 0
Post likes count 0

Windows PowerShell and the Azure Text-to-Speech Rest API (Part 1)

Doctor Scripto
Doctor Scripto

Summary: You can use Windows PowerShell to authenticate to the Microsoft Cognitive Services Text-to-Speech component through the Rest API. Q: Hey, Scripting Guy! I heard about the cool Microsoft Cognitive Services, and had heard they have a REST API. Does that mean I can use PowerShell to consume them? Could you show me how to authenticate to it? —SH A: Hello SH, I just love waking up and saying "YES YOU CAN!" when people ask "Can you do that with Windows PowerShell?" So… ahem…. "Yes you can!" For those who didn't know, Cognitive Services are hosted in the Azure cloud, and they allow you to many things eas...

PowerTip: Use PowerShell to read an RSS feed
Feb 21, 2018
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to read an RSS feed

Doctor Scripto
Doctor Scripto

Summary: “Hey, Scripting Guy!” shows you how to use Invoke-RestMethod to read a list of entries from an RSS feed.  How can I use Windows PowerShell to see the list of articles from an RSS feed?       Just use the Invoke-RestMethod and provide the full path to the link to the RSS feed. Here is an example:    Invoke-RestMethod -Uri 'https://blogs.technet.microsoft.com/heyscriptingguy/rss.aspx  

PowerShell and the REST API for the IT pro
Feb 21, 2018
Post comments count 0
Post likes count 0

PowerShell and the REST API for the IT pro

Doctor Scripto
Doctor Scripto

Summary: This post provides a quick introduction to what the REST API is, and how it applies to Windows PowerShell. Q: Hey, Scripting Guy! I can see there is this cool cmdlet called Invoke-RestMethod. I've been told REST API's are all around, and this allows me to consume that data. Could you give me a hand getting started? —SH A: Hello SH, Glad to help out! I remember hearing about REST APIs the first time, thinking they might be a way to take a nap at work. Was I wrong on that one! What a "REST API" is at the most BASIC level is really just a very fancy web Endpoint. You could, if you were really creative, t...

PowerShell for Programmers: How to write a function the right way
Feb 15, 2018
Post comments count 0
Post likes count 3

PowerShell for Programmers: How to write a function the right way

Kory Thacher
Kory Thacher

Just like I mentioned in my first post, PowerShell supports a lot of stuff that makes it pretty easy to dive in and get stuff running. The following two examples are supported in PowerShell, but not something you should really be doing for any reusable tool set. Putting your parameters (arguments) next to the function name in parenthesis is pretty standard in most languages, but in PowerShell it will limit your functionality. Similarly, $args will stop working for you if you add some of those more useful features, but I’ll show you a way to mimic the functionality on your own later. So, how should you b...

PowerShell for Programmers: What happened to my operators?
Feb 1, 2018
Post comments count 0
Post likes count 2

PowerShell for Programmers: What happened to my operators?

Kory Thacher
Kory Thacher

Operators are one of the most frustrating things about learning PowerShell if you’re coming from just about any other language in existence. Operators like ==, <=, !=. etc. are almost ubiquitous in programming, but none of them are supported in PowerShell. This can lead to some pretty frustrating errors with things like If statements. You might see:   In PowerShell we are still going to have all these operators, they are just going to look different, using dashes and vaguely resembling parameters. I wondered the reason behind this myself for a while, and made a pretty inaccurate guess, but...

PowerShell for Programmers: Basic Syntax – Variables, Objects, and Data Types
Jan 18, 2018
Post comments count 0
Post likes count 2

PowerShell for Programmers: Basic Syntax – Variables, Objects, and Data Types

Kory Thacher
Kory Thacher

Variables Variables in PowerShell are going to be a bit different than they are for you in most languages. To start out the conversation, the basic way to create a variable is just by using a “$” and an “=”, but there are cmdlets and other ways to generate them.   Objects Objects are going to work how they do most places. Dot notation lets us dig into their properties and methods. If you want to see your object’s members, we have several options: 1. Get-Member: you’ll notice the definitions look a lot like you’re used to in C-based lang...

PowerShell for Programmers: A Quick Start Guide
Jan 4, 2018
Post comments count 0
Post likes count 3

PowerShell for Programmers: A Quick Start Guide

Kory Thacher
Kory Thacher

Now that my content has been migrated to the scripting blog, this will be the landing page for the series and I'll be trying to update all the links.  Learning PowerShell can be very useful for people with programming experience. Whether you’re currently a developer, dev-ops, or an admin you can get some serious use out of being familiar with PowerShell. You might think its just a version of command prompt with an eye-burning color scheme, but it really is a full scripting language with lots of nice tie ins. PowerShell is geared towards IT admins and made easy to learn with lots of nice shortcuts, and auto-...

PowerShell For Programmers: Basic Syntax — CMDLETs
Jan 4, 2018
Post comments count 0
Post likes count 4

PowerShell For Programmers: Basic Syntax — CMDLETs

Kory Thacher
Kory Thacher

PowerShell might look really strange to you. Many people assume PowerShell is basically CMD-prompt 2.0 because of the way it looks, but it really is a fully operational scripting language underneath. PowerShell has something called a cmdlet (command-let), which for the most part is the same idea as functions you're used to from other languages. I'll assume you're coming from a more classic language and you're used to calling functions like this: If you've been using cmdlets in PowerShell like this, you've been doing it wrong. This could cause you some serious problems down the line. "But I can type ...

Cross-platform PowerShell remoting in action
Dec 29, 2017
Post comments count 0
Post likes count 0

Cross-platform PowerShell remoting in action

Doctor Scripto
Doctor Scripto

Summary: Learn how to configure and use cross-platform PowerShell remoting in PowerShell Core. I’m Christoph Bergmeister, a London-based full stack .NET software developer with a passion for DevOps. To enable product testing of .NET Core apps across non-Windows machines in CI, I was one of the first people to use the new cross-platform remoting capabilities based on an integration of OpenSSH with PowerShell Core. In the early days, setup was very tedious, and as part of my journey I had to experiment a lot to get everything working together nicely. Today, I want to share with you some of what I learned. Introduc...

Script Wars: The Farce Awakens (part V)
Dec 22, 2017
Post comments count 0
Post likes count 0

Script Wars: The Farce Awakens (part V)

Doctor Scripto
Doctor Scripto

Summary: Rey is skilled in PowerShell, and new to Contoso Holly Jolly Hat Company. Already she has been a great boon to her new co-workers and had her sneakers become the subject of a hungry trash robot. She was just about to walk out to the hall with Ben Kerberosie, when suddenly an dominant figure has blocked them, with the following words booming through the hall: "WHO DO I SPEAK TO ABOUT CLEAR TEXT PASSWORDS in POWERSHELL!?!" ---------------------- That entity was none other than Katherine Phantampa! Head of IT Security, and also known as The Gatekeeper. The Protector of Data. The Guardian of all that was...

Script Wars: The Farce Awakens (part IV)
Dec 21, 2017
Post comments count 0
Post likes count 0

Script Wars: The Farce Awakens (part IV)

Doctor Scripto
Doctor Scripto

Summary: A quick recap shall we? Newly graduated from IT training and future guru in the world of Windows PowerShell, Rey Skyworker has been hired on by her mentor, Ben Kerberosie. Already, she has helped peers from her team improve their PowerShell code to do some basic error trapping and cleanup of the data upon entry. Not bad for somebody on their first day, eh? Oh, almost forgot, her shoelaces have been chosen as lunch by a new Beta cleaning robot with more suction than common sense. Shall we continue? Let's! -------------------------- Tin has been left back to tend to the help desk, while Ben continues ...

Script Wars: The Farce Awakens (part III)
Dec 20, 2017
Post comments count 0
Post likes count 0

Script Wars: The Farce Awakens (part III)

Doctor Scripto
Doctor Scripto

Summary: When last we saw our hero, Rey Skyworker, she was aiding her new co-worker, Tin. They managed to implement better error trapping by using the "Try Catch" statement in Windows PowerShell. The fact they could do this so easily it has tickled Tin's curiosity. ---------------------------- "Now Rey, I'm looking at this and as I see it, I could avoid the error altogether by trapping for those situations. Maybe adding in a few IF statements like this to the script." If (($First -or $Last)) -eq '') then { Write-Output 'Names cannot be blank } Else { ….rest of the script } Rey nodded. "You mean adding ...

Script Wars: The Farce Awakens (part II)
Dec 19, 2017
Post comments count 0
Post likes count 0

Script Wars: The Farce Awakens (part II)

Doctor Scripto
Doctor Scripto

Summary: Yesterday, we met a newly graduated IT professional, Rey Skyworker, as she discussed the ways of "The Farce." It was during this discussion that her instructor, Ben Kerberosie, discovered she had a natural gift in understanding how to implement some good practices into writing her scripts. Today, we sit quietly (I mean all of you in the back too, no chattering and tossing about popcorn!), as Rey is about to embark on her new job. The position: on the help desk. The company: Contoso Holly Jolly Hat Company. She is being introduced to her new co-worker on the help desk, Jeremy Tinnison. ---------------...

Script Wars: The Farce Awakens (part I)
Dec 18, 2017
Post comments count 0
Post likes count 0

Script Wars: The Farce Awakens (part I)

Doctor Scripto
Doctor Scripto

Summary: Seven years ago, “Hey, Scripting Guy!” was approached by a member of the community to see if we would be interested in doing something a little fun for the holidays.  The result was a seven-part series called “A PowerShell Carol.” So when we were approached continuously in following years, we allowed this madness to continue! The tradition continued on with the "Blues" in Blueville and Curly Blue, amongst others, doing a twist on popular holiday stories. The community even dared to touch upon classic tales, with "Oliver Script," a "twist" on another famous story by Mr. Dickens. And now, we bring you th...

PowerShell support for certificate credentials
Dec 15, 2017
Post comments count 0
Post likes count 0

PowerShell support for certificate credentials

Doctor Scripto
Doctor Scripto

Summary: It's not a very well-known feature, but the PSCredential object, and the PowerShell Get-Credential cmdlet, both support certificate credentials (including PIN-protected certificates). In this post, we take a look at how a certificate credential is marshaled inside a PSCredential object, how you can do this marshaling yourself, and how you can retrieve the original certificate from a PSCredential object supplied to you. Most Win32 APIs that support the PSCredential object for credential validation already support certificates. However, if your code currently consumes a PSCredential, and you use the user ...

Visual Studio Updates for Office 365 APIs Tools
Dec 14, 2017
Post comments count 0
Post likes count 0

Visual Studio Updates for Office 365 APIs Tools

ScriptingGuy1
ScriptingGuy1

As we recently detailed on the Office Developer blog, we are making it simpler and easier for developers to connect to Office 365 through the Microsoft Graph. For Visual Studio developers currently using the Office 365 API Tools to create applications, you should plan to transition your apps to use Microsoft Graph to access Office 365 data directly. Call to Action You can use the Microsoft Graph Quick Start Guide to learn the quickest way to get started with Microsoft Graph for the platform of your choice. Or, you can use Office 365 Connected Services docs for Microsoft Graph if you have Visual Studio...

Connect(); 2017: SmartHotel360 Demo Apps and Architecture
Dec 13, 2017
Post comments count 0
Post likes count 0

Connect(); 2017: SmartHotel360 Demo Apps and Architecture

ScriptingGuy1
ScriptingGuy1

Last month we hosted Microsoft Connect(); in New York City. Connect(); is a three-day, in-person and online developer event. If you missed it, no worries! You can watch our keynotes, sessions, and on-demand videos on Channel 9. For the past five months our keynote demo team worked on a new set of reference apps. We used most of these apps and Azure backend for our keynote demos. As every year, today we are delighted to share the availability of our newest reference sample apps and Azure backend: SmartHotel360 in GitHub. SmartHotel360 is a fictitious smart hospitality company showcasing the future of connected...

Easily Create IoT Edge custom modules with Visual Studio Code
Dec 12, 2017
Post comments count 0
Post likes count 0

Easily Create IoT Edge custom modules with Visual Studio Code

ScriptingGuy1
ScriptingGuy1

At the recent Connect(); 2017 in November, we announced public preview of Azure IoT Edge. Now you can bring the intelligence of the Cloud right to the IoT Edge as well as easily create and manage business logic for your devices. The new Azure IoT Edge extension for Visual Studio Code along with the updated Azure IoT Toolkit extension will make your IoT Edge developments a real pleasure, providing a set of functionalities including: Get Started with IoT Edge in Visual Studio Code First things first, let’s start by answering the obvious question - What is IoT Edge? What can it do and how does i...

Sky’s the limit with Azure, ASP.NET Core, and Visual Studio for Mac
Dec 11, 2017
Post comments count 0
Post likes count 0

Sky’s the limit with Azure, ASP.NET Core, and Visual Studio for Mac

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!] Cloud services represent a huge leap in functionality, performance, and management simplicity for web apps, APIs, mobile backends, and more. To help you get started with cloud-based development in Visual Studio for Mac, today we're publishing two new hands-on labs: publishing your ASP.NET Core web app to Azure, and connecting your ASP.NET Core web app to Azure SQL Database. These two labs will help d...

Share UI Code in any iOS and Android App with .NET Embedding
Dec 11, 2017
Post comments count 0
Post likes count 0

Share UI Code in any iOS and Android App with .NET Embedding

ScriptingGuy1
ScriptingGuy1

One of the most exciting announcements during this year’s Connect(); event was the ability to embed .NET libraries into existing iOS (Objective-C/Swift) and Android (Java) applications with .NET Embedding. This is great because you can start to share code between your iOS and Android applications, and you can also share the user interface between your apps when you combine .NET Embedding with Xamarin.Forms Native Forms. This means that you can leverage your existing investments and apps without having to re-write them from scratch to start adding cross-platform logic and UI. In fact, during the Connect(); keynote...

Visual Studio 2017 Version 15.6 Preview
Dec 7, 2017
Post comments count 0
Post likes count 0

Visual Studio 2017 Version 15.6 Preview

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!] A few days ago we released Visual Studio 2017 version 15.5 and an update to Visual Studio for Mac, and today we are releasing the first preview of the next minor update: Visual Studio 2017 version 15.6. You can either download the Preview, or, if you already have it installed, click on the notification you’ll receive in the product informing you that the update is available. This latest preview conta...

Post-Connect(); 2017 Visual Studio Partner Webinar Series
Dec 7, 2017
Post comments count 0
Post likes count 0

Post-Connect(); 2017 Visual Studio Partner Webinar Series

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!] Earlier this week, we released 13 Visual Studio partner webinars that build off of some of the major announcement areas of Connect(); 2017 and provide applications of developer tools that, literally, 'connect' with the latest and greatest from Azure, SQL Server 2017, and Visual Studio. Developer Tools for Application Innovation Scott Guthrie introduced advancements in developer productivity in the c...

Snapshot Debugging with Visual Studio 2017: Now Ready for Production
Dec 6, 2017
Post comments count 0
Post likes count 0

Snapshot Debugging with Visual Studio 2017: Now Ready for Production

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!] Earlier this year we previewed the Snapshot Debugger, a tool that enables you to debug web apps running in production in Azure. With the general availability of Visual Studio 2017 Enterprise 15.5 this week, Snapshot Debugger is now available for you to get started. Read more about how here. Snapshot Debugging Overview If an issue happens in production, you may find yourself digging through logs or att...

Join Us to Learn How to Build Android 8.0 Oreo and iOS 11 apps with Visual Studio
Dec 5, 2017
Post comments count 0
Post likes count 0

Join Us to Learn How to Build Android 8.0 Oreo and iOS 11 apps with Visual Studio

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!] Visual Studio and Xamarin enable .NET developers everywhere to use their favorite language and full-featured IDE to create native Android, iOS, and UWP apps, even incorporating the latest and greatest from Android 8.0 Oreo and iOS 11. To help you get the most out of the new Google and Apple APIs, we’re hosting two webinars: one for all things Android 8.0 Oreo and one dedicated to iOS 11. In these web...

Visual Studio 2017 Version 15.5, Visual Studio for Mac Released
Dec 4, 2017
Post comments count 0
Post likes count 0

Visual Studio 2017 Version 15.5, Visual Studio for Mac Released

ScriptingGuy1
ScriptingGuy1

[Hello, we are looking to improve your experience on the Visual Studio Blog. It will be very helpful if you could share your feedback via this short survey that should take less than 2 minutes to fill out. Thanks!]   Today we released significant updates to both Visual Studio 2017 and Visual Studio for Mac. I’ll share some details in this post, but as always, there’s a lot more information in the release notes. If you’d like to jump right in, download Visual Studio 2017 version 15.5 and download Visual Studio for Mac. Visual Studio 2017 Version 15.5 This update contains major performance improvements, new ...

Announcing JUnit Support for Visual Studio Code
Dec 1, 2017
Post comments count 0
Post likes count 0

Announcing JUnit Support for Visual Studio Code

ScriptingGuy1
ScriptingGuy1

Today, we’re pleased to release a new extension to our Visual Studio Code Java extension family - Test Runner/Debugger for Java. It’s a lightweight test runner/debugger with below features we hope you will like. Same as the Debugger for Java, this is also an open source project. Please check out the github page https://github.com/Microsoft/vscode-java-test/ for more details and feedback. Along with the new extension, we’re also updating our Debugger extension with version 0.4.0. With this release, we’re adding a few useful tools to make Java debugger in VS Code more enjoyable. Launch in terminal ...

TFVC support and other enhancements hit Continuous Delivery Tools for Visual Studio
Nov 27, 2017
Post comments count 0
Post likes count 0

TFVC support and other enhancements hit Continuous Delivery Tools for Visual Studio

ScriptingGuy1
ScriptingGuy1

A year ago, we released the first preview of the Continuous Delivery Tools for Visual Studio (CD4VS) with support for configuring a continuous integration and continuous delivery pipeline for ASP.NET and ASP.NET Core projects with and without container support. With CD4VS you can always configure Continuous Delivery for solutions under source control to App Service, and Service Fabric Clusters. Today, we announce the support for configuring Continuous Delivery for solutions under TFVC source control on VSTS. When you click configure Continuous Delivery on the solution menu, CD4VS detects the source control prov...

Announcing Language Server Protocol Preview Release
Nov 21, 2017
Post comments count 0
Post likes count 0

Announcing Language Server Protocol Preview Release

ScriptingGuy1
ScriptingGuy1

Visual Studio is joining Visual Studio Code in offering support for the Language Server Protocol. As an extension author, you can now write Visual Studio extensions that leverage existing language servers to provide a rich editing experience for languages that initially had no native language support in Visual Studio. With these extensions, you can use Visual Studio to code in your favorite language! This is a preview release that is available as an extension on Visual Studio Marketplace and can only be installed on Visual Studio 2017 Preview. Read our documentation to find out more. What is an LSP? The Langua...

Overview of Visual Studio 2017 and Updates for .NET Developers
Nov 20, 2017
Post comments count 0
Post likes count 0

Overview of Visual Studio 2017 and Updates for .NET Developers

ScriptingGuy1
ScriptingGuy1

Visual Studio 2017 first released in March of this year. Since then, there have been five updates with each bringing more improvements and capabilities. Every improvement is geared towards making you more productive and this post aims to give you an overview of the culmination of features to date. Read on to see how you can get started working on your projects quickly and write better code faster. Download Visual Studio 2017 Preview today. New Install Experience, Performance and Reliability The first thing you’ll notice with Visual Studio 2017 is the new install experience which lets you pick and choose which de...

Large C# and VB solutions load significantly faster in 15.5 update
Nov 20, 2017
Post comments count 0
Post likes count 0

Large C# and VB solutions load significantly faster in 15.5 update

ScriptingGuy1
ScriptingGuy1

On average, 50 percent of all solutions opened by Visual Studio users open in ten seconds or less. However, large solutions can take longer to load because there are a lot of projects that Visual Studio needs to process. Over the last six months, we looked at ways to make solution load much faster, even for large solutions. We are happy to share that with update 15.5, Visual Studio 2017 loads C# and Visual Basic projects twice as fast as before. (C++ solution load was optimized earlier in Visual Studio 2017, as described here.) This video compares loading the Orchard Content Management System solution before an...

Managing Secrets Securely in the Cloud
Nov 17, 2017
Post comments count 0
Post likes count 0

Managing Secrets Securely in the Cloud

ScriptingGuy1
ScriptingGuy1

You’ve probably heard some version of the story about a developer who mistakenly checked in his AWS S3 key to Github. He pulled the key within 5 minutes but still racked up a multi-thousand dollar bill from bots that crawl open source sites looking for secrets. As developers we all understand and care about keeping dev and production secrets safe but managing those secrets on your own or especially in a team can be cumbersome. We are pleased to announce several new features that together will make detecting secrets in code and working with secrets stored securely on Azure easier than it’s ever been before. ...

Test Experience Improvements
Nov 16, 2017
Post comments count 0
Post likes count 0

Test Experience Improvements

ScriptingGuy1
ScriptingGuy1

There have been several significant improvements to the test experience that range across Visual Studio and Visual Studio Team Services. These efforts involved frameworks and tooling for both .NET and C++, but all had a common goal: make testing with our developer tools a great experience. .NET Side-by-side Performance Comparison These improvements are best shown in a side-by-side comparison of Visual Studio 2017 15.4 and Visual Studio 2017 15.5 Preview 2 with the Real Time Test Discovery feature flag turned on. Wow! How did you get that performance?! The performance improvements are thanks to work in a few dif...

Spend more time working on the interesting stuff
Nov 16, 2017
Post comments count 0
Post likes count 0

Spend more time working on the interesting stuff

ScriptingGuy1
ScriptingGuy1

There’s a reason that each day thousands of developers take advantage of the rich set of extensions offered by our growing family of VS and VSTS Partners and the broader VS community. Collectively these offerings can save you and your team time in many different ways, from helping find bugs faster, to making it easier to work with data, to helping create great UX. I’m excited to be here at Connect(); this week where our partners are announcing a slew of exciting new products and updates for developers in tandem with our own developer productivity announcements. Here's a quick overview of these updated and new a...

Keep Your Skills Up to Date: New Training and Azure Resources
Nov 15, 2017
Post comments count 0
Post likes count 0

Keep Your Skills Up to Date: New Training and Azure Resources

ScriptingGuy1
ScriptingGuy1

Finding better ways to upskill is a consistent topic that comes up when we talk to you about what’s top of mind. It’s no wonder when the one constant in our industry is change with new techniques, frameworks, tools, and languages emerging all the time. Developers by nature are extremely self-reliant when it comes to dealing with this change. Over 90% of the respondents on StackOverflow’s 2017 Developer Survey indicated that they were at least partially self-taught. Whether through coding boot camps, online courses, online forums/Q+A, or joining an OSS project, you are using a variety of ways to level up your ski...

The Latest in Developer Productivity and App Experiences
Nov 15, 2017
Post comments count 0
Post likes count 0

The Latest in Developer Productivity and App Experiences

ScriptingGuy1
ScriptingGuy1

Whatever the language or platform, developers want the same thing - to create app experiences that are high-quality, intelligent and personalized. Experiences that delight users and keep them engaged. To do that, we need tools that increase our productivity, so that we spend more time on what matters most to our app's success. At Connect(); 2017 we are showcasing new tools and services that demonstrate Microsoft’s commitment to developer productivity and incredible app experiences. Visual Studio App Center – Build, Test, Deploy, Engage, Repeat. Today we announced the General Availability of Visual Studio App Cen...

Run and Debug Java 9 in Visual Studio Code
Nov 10, 2017
Post comments count 1
Post likes count 0

Run and Debug Java 9 in Visual Studio Code

ScriptingGuy1
ScriptingGuy1

In the past 3 weeks, we’ve continued to see a lot of people installing and trying our tools, reading our documents, and visiting our repository. We’ve also seen a number of new issues opened by the Java community. Thank you all for trying our tools and providing feedback, all of which is motivating us to make VS Code a better tool for Java developer. With our new 0.3.0 release, we have added a few new capabilities and addressed your top feedback. Java 9 Support Java 9 was officially out just weeks after the initial release of our debugger. To allow more and more developers to try the new version of Java with VS C...

Visual Studio IDE extensions now published and managed at Marketplace
Nov 9, 2017
Post comments count 0
Post likes count 0

Visual Studio IDE extensions now published and managed at Marketplace

ScriptingGuy1
ScriptingGuy1

Consumers of Visual Studio IDE extensions visit Visual Studio Marketplace to discover and acquire extensions. But extension publishers visit Visual Studio Gallery to publish and manage their Visual Studio IDE extensions. Henceforth, extension publishing and management will also be in Marketplace. In this process, all extensions in Gallery will be automatically moved over to Marketplace. Marketplace now serves as a single place for extension publishers and consumers to publish, manage or acquire extensions. Benefits of publishers moving to Marketplace   To publish and manage an exte...

Reverse Desired State Configuration: How it works
Oct 27, 2017
Post comments count 0
Post likes count 0

Reverse Desired State Configuration: How it works

Doctor Scripto
Doctor Scripto

Nik Charlebois is a Premier Field Engineer based out of Canada. He is the author of several books on SharePoint automation, and he writes blog posts on a regular basis about all things PowerShell. You can find out more about his work here. ReverseDSC PowerShell Desired State Configuration (DSC) has been around for a few years now, and many organizations are using it to help them automate parts of their DevOPS pipeline. There are now several hundred DSC modules available in the PowerShell Gallery. This enables organizations to create a complex automation solution that allows them to manage, via DSC, different comp...

Use Docker to automate testing of PowerShell Core scripts
Oct 3, 2017
Post comments count 0
Post likes count 0

Use Docker to automate testing of PowerShell Core scripts

Doctor Scripto
Doctor Scripto

  Summary: Learn the basics about Docker, and see how to use it for PowerShell Core script testing on different operating systems. I'm Dan Ward, a Boston-based .NET software engineer who is just plum crazy about PowerShell and automation. Earlier this year, I uploaded my first GitHub project—a PowerShell whitespace cleaner that also replaces aliases with commands and fixes casing issues. Like any manager of a new project, I was excited to see people using it and providing feedback and enhancement requests. But I became concerned when bug reports started coming in: "But I tested this on my machine before up...

PowerTip: Remove calendar events from a mailbox
Aug 31, 2017
Post comments count 0
Post likes count 0

PowerTip: Remove calendar events from a mailbox

Doctor Scripto
Doctor Scripto

Summary: Remove calendar events within an Exchange Online mailbox.     Is there an easy way to remove calendar events from within an Exchange Online mailbox?         Yes there is. There is a newly deployed cmdlet to Office 365 tenants: Remove-CalendarEvents. This cmdlet is currently only available in Exchange Online, but it does allow administrators to remove calendar events, with an attendee, from an owner's mailbox. Here are three examples: Remove-CalendarEvents -Identity chris@contoso.com -CancelOrganizedMeetings This example cancels every meeting in the mailbox chris@contoso.com that occurs on or after today...

Weekend Scripter: Exchange add-in module
Aug 11, 2017
Post comments count 0
Post likes count 0

Weekend Scripter: Exchange add-in module

Doctor Scripto
Doctor Scripto

Summary: Mike O'Neill, Microsoft Senior Premier Field Engineer, created an Exchange add-in module. This is a PowerShell module for Exchange engineers. The module takes into account both on-premises and hybrid deployed Exchange environments. It is a combination of several other scripts that are either on the internet, or are action items you might need help with in your day-to-day tasks. By combining several lines of code into a single verb-noun cmdlet, it makes repeatable, mundane tasks much easier. In fact, once you have the hang of them, you could delegate them out to other team members with a few minutes of ...

Hey, Scripting Guy! update
Jul 26, 2017
Post comments count 0
Post likes count 0

Hey, Scripting Guy! update

Doctor Scripto
Doctor Scripto

Ed Wilson retired, but we are continuing his legacy of friendly tutorials on solving common problems. We will also help IT professionals expand their skill set beyond what might be their comfort zone. Examples of this include incorporating continuous integration/continuous deployment (CI/CD) tools into core infrastructure management, and hybrid cloud operations. Ed actively recruited contributors to submit new content.  We are continuing that tradition by making "Hey, Scripting Guy!" a community effort. In the spirit of getting people started in the wide world of scripting for the cloud, we are asking that propo...

Debugging PowerShell script in Visual Studio Code – Part 2
Feb 13, 2017
Post comments count 1
Post likes count 2

Debugging PowerShell script in Visual Studio Code – Part 2

Doctor Scripto
Doctor Scripto

Welcome to Part 2 of the series about how to debug PowerShell in Visual Studio Code. In Part 1, we looked at the debugging features of Visual Studio Code with the PowerShell extension installed.  Now we will examine the various ways that you can start to debug PowerShell script with Visual Studio Code. Single file debugging With the 1.9 release of Visual Studio Code, you can now debug a PowerShell script with no debugger configuration required and no need to open a workspace. That is, you can open a single PowerShell file instead of a folder and still debug it. In the following example, I open a single script fi...

Cloud operating system deployment: WinPE in Azure
Feb 9, 2017
Post comments count 0
Post likes count 0

Cloud operating system deployment: WinPE in Azure

Doctor Scripto
Doctor Scripto

Jason Ryberg is a Consultant for Microsoft, where he writes PowerShell code and provides DevOps support.  Have you ever wanted to boot to WinPE in Azure and select an Microsoft Deployment Toolkit (MDT) Task Sequence?  As part of an informal cloud-readiness evaluation, I was asked to deploy a server image to Azure. The image that I was given would run the MDT Deployment Wizard to allow for the selection of deployment options. But, how could I choose deployment options if I could not reach the Azure virtual machine in the boot environment? Read on to find out how to interact with an Azure virtual machine in a prebo...

Announcing the 2016 Honorary Scripting Guys
Feb 7, 2017
Post comments count 0
Post likes count 0

Announcing the 2016 Honorary Scripting Guys

Doctor Scripto
Doctor Scripto

Summary: The Honorary Scripting Guys for 2016 are announced. Microsoft Scripting Guy, Ed Wilson, is here. Well, it has been an awesome year for Windows PowerShell and for the community. The Scripting Wife and I had the opportunity to speak at lots of user groups and conferences last year. This involved many, many miles of travel. Luckily, the community pitched in and helped – a lot – with the Scripting Guys blog … and so, once again, it was the top Microsoft blog. The cool thing about a strong community – and of community contributions to the blog is that we can get lots of different views about how we can use W...

Debugging PowerShell script in Visual Studio Code – Part 1
Feb 6, 2017
Post comments count 6
Post likes count 3

Debugging PowerShell script in Visual Studio Code – Part 1

Doctor Scripto
Doctor Scripto

Summary: Here's a look at the many features of the PowerShell debugger for Visual Studio Code. In previous blog posts, we covered how to get started with PowerShell development in Visual Studio Code and the editing features of Visual Studio Code and the PowerShell extension.  If you don’t already have Visual Studio Code configured with the PowerShell extension, read those blog posts to get caught up. In the first of this two-part series, we will cover the many features of the PowerShell debugger for Visual Studio Code.  These features are provided by the PowerShell extension, or, more accurately, by the PowerSh...

PowerTip: Get a list of security patches installed in the last 90 days
Feb 3, 2017
Post comments count 0
Post likes count 0

PowerTip: Get a list of security patches installed in the last 90 days

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to get a list of all the security patches installed in the last three months. How can I list all the security patches that I’ve installed in the last 90 days? There’s a class for that! Just use , and you can retrieve this information. Here is an example:

PSScriptAnalyzer deep dive – Part 4 of 4
Feb 3, 2017
Post comments count 3
Post likes count 1

PSScriptAnalyzer deep dive – Part 4 of 4

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows how to write a custom PSScriptAnalyzer rule. Hello! I’m Thomas Rayner, a Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a four-part series about how to use PSScriptAnalyzer. Part 1 – Getting started with PSScriptAnalyzer Part 2 – Suppressing, including, excluding rules Part 3 - Wrapping PSScriptAnalyzer with Pester to get formatted results Part 4 – Writing custom rules This ...

PowerTip: Get a list of suspended Azure Automation jobs
Feb 2, 2017
Post comments count 0
Post likes count 0

PowerTip: Get a list of suspended Azure Automation jobs

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how get a list of all your suspended Azure Automation jobs. I think I have an Azure Automation job that is getting suspended for running too long. How can I verify this? You can use the cmdlet and its flag to get this information. Here is an example: You can also use other values like , , and in that place.

PSScriptAnalyzer deep dive – Part 3 of 4
Feb 2, 2017
Post comments count 0
Post likes count 1

PSScriptAnalyzer deep dive – Part 3 of 4

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows how to use Pester to get nUnit formatted results out of PSScriptAnalyzer. Hello! I’m Thomas Rayner, a Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a four-part series about how to use PSScriptAnalyzer. Part 1 – Getting started with PSScriptAnalyzer Part 2 – Suppressing, including, excluding rules Part 3 - Wrapping PSScriptAnalyzer with Pester to get formatted results Part 4 ...

PowerTip: Convert from UTC to my local time zone
Feb 1, 2017
Post comments count 0
Post likes count 0

PowerTip: Convert from UTC to my local time zone

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how write a function to convert from UTC to your local time zone. I have a time that I’d like to convert from UTC to my local time zone. How can I do this? You can write your own function to do this, and use the [System.TimeZoneInfo] .NET class and associated methods to make this conversion easily. Here is an example: { param( [parameter(Mandatory=$true)] [String] $UTCTime ) $strCurrentTimeZone = (Get-WmiObject win32_timezone).StandardName $TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById($strCurrentTimeZone) $LocalTime = [System.TimeZoneInf...

PSScriptAnalyzer deep dive – Part 2 of 4
Feb 1, 2017
Post comments count 0
Post likes count 1

PSScriptAnalyzer deep dive – Part 2 of 4

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows how to suppress, include, and exclude PSScriptAnalyzer rules. Hello! I’m Thomas Rayner, a Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a four-part series about how to use PSScriptAnalyzer. Part 1 – Getting started with PSScriptAnalyzer Part 2 – Suppressing, including, excluding rules Part 3 - Wrapping PSScriptAnalyzer with Pester to get formatted results Part 4 – Writing cu...

PowerTip: Find all the Azure Automation jobs that will run in the next two days
Jan 31, 2017
Post comments count 0
Post likes count 0

PowerTip: Find all the Azure Automation jobs that will run in the next two days

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to find all the Azure Automation jobs that will run in the next two days. Is there a way to find all the Azure Automation jobs that will run in the next two days? Use the cmdlet, and check out the attribute. Here is an example:

PSScriptAnalyzer deep dive – Part 1 of 4
Jan 31, 2017
Post comments count 0
Post likes count 2

PSScriptAnalyzer deep dive – Part 1 of 4

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics about how to use PSScriptAnalyzer. Hello! I’m Thomas Rayner, a Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a four-part series about how to use PSScriptAnalyzer. Part 1 – Getting started with PSScriptAnalyzer Part 2 – Suppressing, including, excluding rules Part 3 - Wrapping PSScriptAnalyzer with Pester to get formatted results Part 4 – Writing custom rules This...

Nearly everything has changed for SQL Server PowerShell
Jan 25, 2017
Post comments count 0
Post likes count 1

Nearly everything has changed for SQL Server PowerShell

Doctor Scripto
Doctor Scripto

2016 was the best year in SQL PowerShell history! I guess I should have mentioned that here sooner. Wired® Magazine recently said that Microsoft SQL Server was the surprise hit of the year. The primary cited reason is the SQL Server port to Linux, but there are several other reasons to be really excited about SQL Server and SQL Server PowerShell is one of them. Independent, frequent releases of SSMS Thanks to the new release cycle of SQL Server Management Studio (SSMS), which comes out nearly every month, the SQL Tools team could deliver even more without making us wait until the next major release of SQL Server...

View passwords of wireless profiles without using netsh.exe
Jan 13, 2017
Post comments count 0
Post likes count 0

View passwords of wireless profiles without using netsh.exe

Doctor Scripto
Doctor Scripto

Ever since the GUI lost the ability to view the password of a wireless profile, I wanted to provide this functionality in PowerShell. A search of the Internet for how to view the password of a Wi-Fi profile returns numerous examples of how to use netsh.exe to accomplish this. I wrote a previous blog post about how to view Wi-Fi profiles, and the method I used returned objects, but still relied on netsh.exe. I had some free time, and I wanted to learn about p/invoke, so I wrote a PowerShell module to do this. Let’s look at how to do this without netsh. If there isn’t a cmdlet or method in .NET to get what you wan...

Visual Studio Code editing features for PowerShell development – Part 2
Jan 12, 2017
Post comments count 0
Post likes count 4

Visual Studio Code editing features for PowerShell development – Part 2

Doctor Scripto
Doctor Scripto

Summary: Editing features for Visual Studio Code that use the PowerShell extension. Welcome to Part 2 about editing features of Visual Studio Code. Everything that we  examined in Part 1 of this series is about Visual Studio Code editing features that are available without the PowerShell extension installed! They apply to your markdown, JSON, XML, and YAML files. Now, let’s look at additional editing features the PowerShell extension provides. IntelliSense With the PowerShell extension, you get IntelliSense for commands, command parameters, .NET type names, member names, and method parameter information as shown...

Visual Studio Code editing features for PowerShell development – Part 1
Jan 11, 2017
Post comments count 0
Post likes count 2

Visual Studio Code editing features for PowerShell development – Part 1

Doctor Scripto
Doctor Scripto

Summary: The editing features of Visual Studio Code come in handy as you develop your PowerShell scripts. Note: This post includes animated gifs. For best results, view the post in Internet Explorer or Microsoft Edge. In the previous blog post, we explained how to get started with PowerShell development in Visual Studio Code. If you don’t have Visual Studio Code configured with the PowerShell extension, read that blog post first to get caught up. Since that blog post, there have been two important updates. First, Visual Studio Code has been updated to 1.8. One significant new feature in Visual Studio Code 1.8 is ...

SharePoint Online cmdlets to help your migration
Jan 9, 2017
Post comments count 0
Post likes count 0

SharePoint Online cmdlets to help your migration

Doctor Scripto
Doctor Scripto

Summary: Use these PowerShell cmdlets to migrate to SharePoint Online. Today’s post is from Christopher Weaver, who is a Microsoft Premier Field Engineer (PFE) and focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking, kite surfing, and spending time with his kids and dog. You can follow him on his blog at https://blogs.technet.microsoft.com/christwe/. As we prepare our SharePoint Online environment for migration, we will need to be able to manage site coll...

Where[-Object] clauses for people who use SQL Server
Jan 4, 2017
Post comments count 0
Post likes count 1

Where[-Object] clauses for people who use SQL Server

Doctor Scripto
Doctor Scripto

Summary: Learn about the power of the Where[-Object] cmdlet in PowerShell. Can I do a WHERE clause with an IN, in PowerShell?  Yes! Today’s post is from Aaron Nelson ( blog | twitter ), who is a Microsoft MVP for SQL Server (Data Platform), leads the PowerShell Virtual Chapters of PASS, volunteers for the local PASS Chapter AtlantaMDF, and helps organize SQL Saturday events in Atlanta. The PowerShell Virtual Chapter of PASS hosts monthly sessions on SQL Server + PowerShell, and you can find the recordings of those sessions on their YouTube channel. is an extremely important cmdlet. Those of us who use SQL are...

PowerTip: Get the Notes field when accessing users or groups in Active Directory
Dec 25, 2016
Post comments count 0
Post likes count 0

PowerTip: Get the Notes field when accessing users or groups in Active Directory

Doctor Scripto
Doctor Scripto

Summary: Use the Active Directory Module to get the information from the “Notes” field.  I’m trying to find the Active Directory property to use to access the Notes field when I’m viewing a user or a group. Could you lend me a hand? No problem at all. The property you are looking for is and can be added when you use or . I like to add as well to pull in most of the descriptive details. Here is an example:

Curly Blue and the meaning of scripting – Part 5
Dec 25, 2016
Post comments count 0
Post likes count 0

Curly Blue and the meaning of scripting – Part 5

Doctor Scripto
Doctor Scripto

Summary: Curly Blue learns the true meaning of scripting in PowerShell. When we last saw our hero, Curly Blue, he had discovered not only the ease of use of PowerShell but also the vast community resources provided by Github. Because of this one reason alone, his co-workers, Loopy and Codestock, had no need to fret over the upcoming holiday weekend. Their task was solved in a quick and cost-effective manner. Curly sat down to reflect upon his past 24 hours of “intensive PowerShell training” with his co-workers. “At first I came in and was apprehensive about scripting. I personally didn’t find it useful due to...

PowerTip: Get a list of local Users in Windows 10 / Windows Server 2016
Dec 24, 2016
Post comments count 0
Post likes count 0

PowerTip: Get a list of local Users in Windows 10 / Windows Server 2016

Doctor Scripto
Doctor Scripto

Summary: Use the cmdlets provided in PowerShell 5.1 to manage local user accounts on a system. I remember having to use the Active Directory Service Interfaces (ADSI) accelerator to access a list of local users in PowerShell. Is there a cmdlet that could do this now? Yes.  In the most recent version of Windows 10 / Windows Server 2016 with PowerShell 5.1, you can run just one cmdlet to pull up a list of local users.

Curly Blue and the meaning of scripting – Part 4
Dec 24, 2016
Post comments count 0
Post likes count 0

Curly Blue and the meaning of scripting – Part 4

Doctor Scripto
Doctor Scripto

Summary: Curly Blue learns how to use GitHub resources on PowerShell to clean out old office installations. When we last saw our hero, Curly Blue, he had been hanging around the office of Azura and discovering the simple ways he could use Windows PowerShell with minimal learning. In the past few days, he’s seen how easy it is to work and access files by date and time, use features that are built into the Active Directory Administrative Center (ADAC) to identify samples of PowerShell, and pull data by using the Common Information Model (CIM) cmdlets. He was blinking in disbelief. Although he was a master of usi...

PowerTip: Use PowerShell to determine active CIM sessions
Dec 23, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to determine active CIM sessions

Doctor Scripto
Doctor Scripto

Summary: Use the Common Information Model (CIM) cmdlets to pull a list of active sessions to remote workstations. How can I find active CIM sessions on my workstation? Just use this one cmdlet to list all active CIM sessions, and you’re done for the day!

Curly Blue and the meaning of scripting – Part 3
Dec 23, 2016
Post comments count 0
Post likes count 0

Curly Blue and the meaning of scripting – Part 3

Doctor Scripto
Doctor Scripto

Summary: Curly Blue discovers the raw power of Cim-Instance combined with PowerShell remoting. We continue with Curly Blue as he searches understand the meaning of scripting. He is still sitting in the office with Azura. The co-op student, Hermie, has run off to chase something that wandered into his phone. Virus or virtual creature, nobody can ever tell. A new request has just made its way across her desk. The CIO would like a complete inventory of all serial numbers of the company’s workstations. Curly just rolled his eyes. “Over 5,000 workstations! Just where do we even start?” Azura noted his displeasure...

PowerTip: List locked-out accounts in Active Directory with PowerShell
Dec 22, 2016
Post comments count 0
Post likes count 0

PowerTip: List locked-out accounts in Active Directory with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Active Directory cmdlets to identify locked-out user accounts and computer accounts. Is there a quick and easy way to find all users who are locked out in Active Directory by using PowerShell?   You’ll love this. The answer is just one cmdlet away with the ActiveDirectory module. Just use Search-ADAccount, and you’ll have a complete list on your screen.

Curly Blue and the meaning of scripting – Part 2
Dec 22, 2016
Post comments count 0
Post likes count 0

Curly Blue and the meaning of scripting – Part 2

Doctor Scripto
Doctor Scripto

Summary: Curly Blue learns how to use built-in PowerShell script examples in Windows. Yesterday we met our new friends, Curly Blue and Linux. Curly had started his new job as a IT Professional at Contoso. The challenge for poor Curly was that he had never learned scripting or, for that matter, gotten into the spirit of it. He had mastered a unique talent of hyper-active data entry skills combined with keyboard shortcuts. He was now walking to the Office of Azura. She is in charge of managing the migration of the company resources to the cloud. Today she is working with a co-op student, Hermie. “Our big challe...

PowerTip: Limit Get-Childitem to a limited depth in the tree
Dec 21, 2016
Post comments count 0
Post likes count 1

PowerTip: Limit Get-Childitem to a limited depth in the tree

Doctor Scripto
Doctor Scripto

Summary: Use the new -depth parameter to control how far down a directory you can search. I have a large file structure to search but I only want to go two folders deep on the search.  Is there a way to do this in PowerShell? Certainly!  In PowerShell 5.0, you can use the -depth parameter to specify how many branches deep you’d like to limit from the search root. Here, we can search the C:\Users\CurlyBlue folder for DOCX files but only go to two levels below. Here is an example:

Curly Blue and the meaning of scripting – Part 1
Dec 21, 2016
Post comments count 0
Post likes count 0

Curly Blue and the meaning of scripting – Part 1

Doctor Scripto
Doctor Scripto

Summary: Curly Blue learns how to automate cleaning of old data files by using PowerShell. This week, in the spirit of the holidays (and of course the previous six years!), Hey, Scripting Guy is honored to bring forth a repeat of a tradition: The “Hey, Scripting Guy!” holiday special. This year, we are pleased to offer a week of fun and Windows PowerShell with a new story produced as a collaboration of two MVPs, Honorary Scripting Guys, Thomas Rayner and Sean Kearney. This year’s special is about a fellow named Curly Blue who has just started his new job with only a week remaining before the holiday weekend. C...

Make Visual Studio Code more like the integrated scripting environment
Dec 7, 2016
Post comments count 0
Post likes count 0

Make Visual Studio Code more like the integrated scripting environment

Doctor Scripto
Doctor Scripto

Summary: Learn some handy tips to make Visual Studio Code work more like the ISE. I was very intrigued with the release of Visual Studio Code last year. An editor that is light-weight and integrated with Git is something worth considering. Well, any new tool that could be added to the tool box is worth considering. In the past, I used the integrated scripting environment (ISE) as my tool of choice to develop and edit PowerShell scripts but I’m always looking for ways and tools to improve my PowerShell skills. There is a learning curve to Visual Studio Code. The ISE is very intuitive. I have never had much troub...

Get started with PowerShell development in Visual Studio Code
Dec 5, 2016
Post comments count 0
Post likes count 0

Get started with PowerShell development in Visual Studio Code

Doctor Scripto
Doctor Scripto

Summary: Learn about the features in Visual Studio Code that help you write PowerShell code. Since the PowerShell integrated scripting environment (ISE) shipped with Windows PowerShell 2.0 in 2009, the PowerShell landscape has changed significantly. In November 2014, Microsoft took .NET open source and cross-platform. Given PowerShell’s dependence on .NET, this was an important prerequisite before taking PowerShell cross-platform. And, indeed, nine months later, Microsoft made PowerShell available cross-platform, supporting Linux and macOS in addition to Windows. To the surprise of many, Microsoft also open-sour...

PowerTip: Capture the output of a Linux application in PowerShell
Nov 25, 2016
Post comments count 0
Post likes count 0

PowerTip: Capture the output of a Linux application in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the built-in features of PowerShell to obtain data produced by a Linux application. Can I run a Linux application like ls and capture its output in PowerShell? You certainly can!  It’s no different from when you normally grab output from any other command in Windows.   To grab the output of the ls command, for example, just assign it to a PowerShell object as you normally would. The captured output will be all text, and you can run standard methods, Search-String and regular expressions against it.

Open Source PowerShell – Part 4
Nov 25, 2016
Post comments count 0
Post likes count 0

Open Source PowerShell – Part 4

Doctor Scripto
Doctor Scripto

Summary: Install and Configure SSH for Open Source PowerShell remoting. With PowerShell, up to this point, one thing that I love is the ability to connect various systems in my environment and run cmdlets on them remotely.  Can we do this with Open Source PowerShell?  Honorary Scripting Guy, Sean Kearney, is here today to go over how to get Open Source PowerShell set up to do remoting.  Because this, my friends, this is the big game changer. When Linux admins presently need to work with a Windows Server, they need to play with a few options: A Windows admin could typically just download a utility l...

PowerTip: Return a status code to Linux from PowerShell
Nov 18, 2016
Post comments count 0
Post likes count 0

PowerTip: Return a status code to Linux from PowerShell

Doctor Scripto
Doctor Scripto

Summary: Pass a result code back to a calling Linux environment from Open Source PowerShell. How can I pass a numeric value back to a calling Bash Shell to indicate an error? Just simply supply the EXIT command and a numeric value at the point where the error is flagged. For example, the following code is a PowerShell script that returns a value of 76 if the script does not match the value of . If ($Value -eq ‘Something Good’) { Write-Output ‘It’s Good, it’s very Good’ } Else { Exist 76 }

Open Source PowerShell – Part 3
Nov 18, 2016
Post comments count 0
Post likes count 0

Open Source PowerShell – Part 3

Doctor Scripto
Doctor Scripto

Summary: Pass and return data correctly between Bash and Open Source PowerShell. Could you show me some examples of actually passing and returning values between PowerShell and Bash? Honorary Scripting Guy, Sean Kearney, is here today and we’ll do exactly that. It isn’t difficult to actually to do this either, but there are two things to keep in mind to make all of this easier. When working with data: If you keep this in mind, much of the challenge is in just understanding that when PowerShell parameters are set, they should be typed correctly by using the appropriate .NET class. You’ll also need to...

PowerTip: Get the status code of a PowerShell script in Bash
Nov 11, 2016
Post comments count 0
Post likes count 0

PowerTip: Get the status code of a PowerShell script in Bash

Doctor Scripto
Doctor Scripto

Summary: Identify the results of a script running in Open Source PowerShell in a Bash environment. Is there any way to see the results of a PowerShell script? For example, if somebody sent an “Exit 42”, could I see it in Linux? All you need to do is examine the $? variable in Linux, just like any other Linux application. Here is an example:

Open Source PowerShell – Part 2
Nov 11, 2016
Post comments count 0
Post likes count 0

Open Source PowerShell – Part 2

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell scripts within Python and Bash (and those within PowerShell). I am curious just how much I can use Open Source PowerShell within Linux and macOS.  Is it an isolated environment, or can it interact with other shells? Thanks for your question.  Our good friend, Honorary Scripting Guy, Sean Kearney, is here today to show you just how well it interacts. Let’s consider something. Most shells, whether it is Bash or CMD.EXE, are just that, a shell. They normally can run some processes and send output to the console. In many cases, those same shells can call up other shells and launch others...

Manage SharePoint Online site collections and the web templates with PowerShell
Nov 10, 2016
Post comments count 0
Post likes count 0

Manage SharePoint Online site collections and the web templates with PowerShell

Doctor Scripto
Doctor Scripto

Summary: PowerShell commands can manage site collections and the web templates that create site collections. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking, kite surfing, and spending time with his kids and dog. You can follow him on his blog at https://blogs.technet.microsoft.com/christwe/. Hello All, As we prepare our SharePoint Online environment for migration, we will need to be ...

Part 3 – Use Azure Automation DSC to Configure Linux and execute PowerShell scripts
Nov 9, 2016
Post comments count 0
Post likes count 0

Part 3 – Use Azure Automation DSC to Configure Linux and execute PowerShell scripts

Doctor Scripto
Doctor Scripto

Summary: Learn how to configure and use PowerShell, Bash, and DSC with Linux. Hi, my name is Stefan Roth (Blog: http://stefanroth.net / Twitter: @stefanroth_net), and I am a Cloud and Datacenter MVP. In my last post of this three-part series, I would like to show you how we are able to hook up the previously installed Linux system to Azure Automation desired state configuration (DSC), deploy a DSC configuration, and apply it to our Linux system. What we are actually going to do is create a cronjob on Linux via Azure Automation DSC. This cronjob will run a PowerShell script on Linux every five minutes to send the...

How to avoid reinventing the wheel in Azure Automation
Nov 8, 2016
Post comments count 0
Post likes count 0

How to avoid reinventing the wheel in Azure Automation

Doctor Scripto
Doctor Scripto

Summary: Take advantage of existing scripts to create your own solutions.   Automation is the number one technical skill that IT needs to have to thrive in today’s quickly changing world. My recommendation is that anything you do for automation you should do in PowerShell, and you should use Azure Automation as your go-to automation solution. (PoSH Wizard illustration courtesy of myITforum.com) The Microsoft Operations Management Suite provides functionality around log analysis, backup and recovery, security and compliance, and IT automation. IT automation uses Azure Automation and is described as a met...

PowerTip:  Capture error code of a PowerShell session in Linux or macOS
Nov 4, 2016
Post comments count 0
Post likes count 0

PowerTip: Capture error code of a PowerShell session in Linux or macOS

Doctor Scripto
Doctor Scripto

Summary: Capture the status code of a PowerShell session in Linux or macOS. Could you show me how to run a PowerShell script in Linux or macOS and capture the status of whether that script succeeded or failed? No problem, my friend. Just run the PowerShell session, and start the script as in the following example. You can view the status in the built-in variable in Linux and macOS.

Open Source PowerShell – Part 1
Nov 4, 2016
Post comments count 0
Post likes count 0

Open Source PowerShell – Part 1

Doctor Scripto
Doctor Scripto

Summary: Find and install the Open Source PowerShell software for Linux or Windows. I was reading up about a great new change in PowerShell. I heard that the newest version was Open Sourced on GitHub. Any chance you could give me a quick run-through to check it out? Honorary Scripting Guy, Sean Kearney, is here today to bring you up to pace with the coolest new change that was introduced ever. The newest version of Windows PowerShell (version 6.0) is on GitHub.com as an Open Source project! Don’t believe me? Check it out right now at https://github.com/PowerShell/PowerShell. To say, “This is big,” is a very...

PowerTip: Know the difference between the .split() method and ‘-split’
Oct 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Know the difference between the .split() method and ‘-split’

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string by using a string instead of just a character. I am trying to split the string “this is my amazing string” on the pattern “my” by using “this is my amazing string”.split(“my”) but it’s giving me a bunch of garbled stuff back. How do I accomplish my goal?  You’ll have to use –split instead of .split(). Methods like .split() and .trim() take arrays of characters instead of strings. What happened to you is that your pattern, “my”, was treated as an array of characters and “this is my amazing string” was split on all of the “m”...

PowerShell regex crash course – Part 5 of 5
Oct 28, 2016
Post comments count 0
Post likes count 2

PowerShell regex crash course – Part 5 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. Regular expressions are extremely ...

Join the PowerShell tenth birthday celebration
Oct 25, 2016
Post comments count 0
Post likes count 0

Join the PowerShell tenth birthday celebration

I_am_mr_ed
I_am_mr_ed

SUMMARY: Microsoft Scripting Guy Ed Wilson announces November 14, 2016 as date for PowerShell 10th anniversary celebration Can you believe that PowerShell is nearly 10 years old (that is a long time in 'internet time')? On November 14, 2016 we will celebrate the occasion with a day-long event that will run from 8 in the morning until 4 in the afternoon (PST). We will stream this live event on the Channel 9 homepage. This is going to be a day long extravaganza befitting the most awesome management, tool ever shipped. We will have segments on SQL and PowerShell, Azure Automation and PowerShell, the future of Powe...

PowerTip: How to use regular expressions to split a string without losing the character you split on
Oct 21, 2016
Post comments count 0
Post likes count 0

PowerTip: How to use regular expressions to split a string without losing the character you split on

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string without losing the character you split on. I’m splitting this file name some file.txt into its name and extension by going “some file.txt” –split “.”. It’s giving me some file and txt, but I want to keep the dot and get .txt instead. How can I do this? You can split on a regex lookahead and split on the space between characters where the character on the right is a dot

PowerShell regex crash course – Part 4 of 5
Oct 21, 2016
Post comments count 0
Post likes count 2

PowerShell regex crash course – Part 4 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. Regular expressions are extremel...

Speed up remote PowerShell connection to Exchange
Oct 17, 2016
Post comments count 0
Post likes count 0

Speed up remote PowerShell connection to Exchange

Doctor Scripto
Doctor Scripto

Summary: Speed up the connection to Exchange by importing only the cmdlets that you need. Is there a way to speed up the initial PowerShell connection to Exchange? Yes, of course! With a little modification to Import-PSSession, we can speed up the connection. Normally, you would connect to Exchange 2010/2013/2016 like this: $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://ex01/PowerShell/?SerializationLevel=Full' -Authentication Kerberos Import-PSSession -Session $session This would import all available cmdlets in the local PowerShell session. But, consider the next...

PowerTip: How to detect a valid Active Directory user name using regular expressions
Oct 14, 2016
Post comments count 0
Post likes count 0

PowerTip: How to detect a valid Active Directory user name using regular expressions

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how use regex to detect if a string is a valid Active Directory user name. The invalid characters for an Active Directory user name are and . How do I tell if a string is a valid Active Directory user name?   You can treat this array of characters as a pattern and see if they exist within the string You’ll have to manually escape and because is a bit quirky.

PowerShell regex crash course – Part 3 of 5
Oct 14, 2016
Post comments count 0
Post likes count 1

PowerShell regex crash course – Part 3 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. Regular expressions are extrem...

PowerTip: How to detect phone numbers using regular expressions
Oct 7, 2016
Post comments count 0
Post likes count 0

PowerTip: How to detect phone numbers using regular expressions

Doctor Scripto
Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to use regex to detect if a string is a phone number. I have an array like , and I need to know which array items are phone numbers. How can I do this? You can compare each item in the array with all its non-digit characters removed and see if that matches your requirements for a phone number. Here in Canada, our phone numbers are 10 digits. Here is an example:

PowerShell regex crash course – Part 2 of 5
Oct 7, 2016
Post comments count 0
Post likes count 1

PowerShell regex crash course – Part 2 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadmin.com. This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. Regular expressions are extremely ...

Part 2 – Install .NET Core and PowerShell on Linux Using DSC
Oct 5, 2016
Post comments count 0
Post likes count 0

Part 2 – Install .NET Core and PowerShell on Linux Using DSC

Doctor Scripto
Doctor Scripto

Summary: Learn how to configure and use PowerShell, Bash, and desired state configuration (DSC) with Linux. Today, Cloud and Data Center MVP Stefan Roth returns for Part 2 of his three-part series about how to configure and use PowerShell, Bash, and desired state configuration (DSC) with Linux. Take it away Stefan … My previous post installed the foundation for this second part. It installed the OMI CIM server and DSC on Linux. In this part, the goal is to run a DSC configuration on Linux to download and install .NET core libraries and Windows PowerShell for Linux. There is a multi-step process to get this don...

PowerTip: How to escape characters in a string using regular expressions
Sep 30, 2016
Post comments count 0
Post likes count 0

PowerTip: How to escape characters in a string using regular expressions

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how escape characters for use in regex. Is there a way to escape characters in a string automatically for use in regex?  Use the method to automatically escape characters in a string so you can use them in regex.

PowerShell regex crash course – Part 1 of 5
Sep 30, 2016
Post comments count 0
Post likes count 1

PowerShell regex crash course – Part 1 of 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner) or posting on my blog, workingsysadmin.com. This week, I’m presenting a five-part crash course about how to use regular expressions in PowerShell. Regular expressions are sequences of characters that define a search pattern, mainly for use in pattern matching with strings. Regular expressions are extremely u...

Part 1 – Install Bash on Windows 10, OMI CIM Server, and DSC for Linux
Sep 28, 2016
Post comments count 0
Post likes count 0

Part 1 – Install Bash on Windows 10, OMI CIM Server, and DSC for Linux

Doctor Scripto
Doctor Scripto

Summary: Learn about the Windows Subsystem for Linux that runs on top of Windows 10. Today we have a guest article written by Stefan Roth. Take it away Stefan … Hi, my name is Stefan Roth, and I am a Cloud and Datacenter MVP. In a couple of posts, I would like to show you how cool it is that Microsoft is touching the Linux world. Myself, I am a 100% Microsoft fan, but, as you can read all over the Internet…Microsoft loves Linux. This is not just a one-night stand. Microsoft is really serious about Linux support in all cloud scenarios (private, public, and hybrid). Therefore, we start with something really cool....

Scripting Guys at Ignite 2016 in Atlanta
Sep 26, 2016
Post comments count 0
Post likes count 0

Scripting Guys at Ignite 2016 in Atlanta

I_am_mr_ed
I_am_mr_ed

SUMMARY: Ed Wilson, Microsoft Scripting Guy, talks about the Scripting Guys booth at Ignite 2016 in Atlanta.Good morning everyone. Ed Wilson, Microsoft Scripting Guy, here. So, the day has finally arrived – after literally months and months of planning, Ignite 2016 in Atlanta has arrived. Well, actually it arrived earlier with the Pre-Con’s yesterday from the Operations Management Suite (OMS) team, and with MVP Days on Saturday. But today is the official kick off for Ignite. The Scripting Wife and I arrived yesterday at the conference center, and it is huge. Our shuttle bus drops us off at the far end of the buil...

PowerTip: Use PowerShell to retrieve the date and time of the given time zone ID
Sep 16, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to retrieve the date and time of the given time zone ID

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to pull out specify TimeZone data from an object. I have data retrieved from an external source that contains different time zone IDs like W. Europe Standard Time, AUS Eastern Standard Time, etc. How can I get the current date time value of it by using PowerShell? In PowerShell, use [System.TimeZone] and invoke the ConvertTimeBySystemZoneID static method, which returns the date-time value of the given time zone!In PowerShell, use [System.TimeZone] and invoke the ConvertTimeBySystemZoneID static method, which returns the date-time value of the given time zone! For example, you need to kn...

Use PowerShell to integrate with the Lync 2013 SDK for Skype for Business – Part 2
Sep 16, 2016
Post comments count 0
Post likes count 0

Use PowerShell to integrate with the Lync 2013 SDK for Skype for Business – Part 2

Doctor Scripto
Doctor Scripto

Summary: Learn how to extend PowerShell with Lync 2013 SDK to explore groups and contacts information in Skype for Business 2016 client. MVP Chendrayan Venkatesan is back again to show us how to get started with the Lync 2013 SDK to enable us to do some cool stuff with PowerShell and Skype for Business! Take it away Chen! Skype for Business 2016 client is great for business users for quick chat, sharing, presentation, organizing meetings, calls etc. Here is the Skype for Business client quick start guide. Please refer to it to understand and manage groups, contacts, and status (presence information). It’s a ve...

PowerTip: Use PowerShell to list all possible colors in the console
Aug 19, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to list all possible colors in the console

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell and enumeration to access all possible colors that you can use in the console. Is there a way to see all of the available colors that I can use when using Write-Host? We sure can! Why, with just one line in PowerShell, you’re all done! Here is an example:

Use PowerShell to integrate with the Lync 2013 SDK for Skype for Business – Part 1
Aug 19, 2016
Post comments count 0
Post likes count 0

Use PowerShell to integrate with the Lync 2013 SDK for Skype for Business – Part 1

Doctor Scripto
Doctor Scripto

Summary: Get started with the Lync 2013 SDK by using PowerShell to manage Skype for Business 2016 client. How do I integrate Windows PowerShell with the Lync SDK to manage Skype For Business client? MVP Chendrayan Venkatesan is back again to show us how to get started with the Lync 2013 SDK and do some really cool stuff with PowerShell and Skype for Business! Take it away, Chen! The Skype for Business 2016 client helps you stay connected with known people by using instant messaging, audio, video call, email, persistent chat rooms, online meetings, and presentations. By using Skype for Business, you can send...

PowerTip: Identify the numeric value of a custom (dingbat) character using PowerShell
Aug 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Identify the numeric value of a custom (dingbat) character using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to determine the value of an Extended ASCII character to reproduce it for later use. I have a really simple question that’s been bugging me. I have a string with a special (Extended ASCII) character that I scraped from some output. I can’t find the ASCII value of it to reproduce it. How can I get the value of this silly “Dingbat”? In PowerShell, all you need to use is the [int] accelerator to get its numerical value! For example, if your special character is stored as a single character in a string called $char, you can find the value like this: For the hexadecimal value, just run the ...

Use PowerShell to report on SharePoint content with custom (dingbat) characters
Aug 12, 2016
Post comments count 0
Post likes count 0

Use PowerShell to report on SharePoint content with custom (dingbat) characters

Doctor Scripto
Doctor Scripto

Summary: Learn how to use PowerShell to retrieve SharePoint list item values as dingbat symbols to make HTML reports simple and clean. Can you show me an example of how to report on my SharePoint data by using something other than the standard ASCII characters? Today we have a special guest MVP, Chendrayan Venkatesan, to help us out! Chendrayan Venkatesan (Chen V) is a SharePoint IT Professional, Cloud and Datacenter Management MVP, Microsoft Community Contributor, Author of Windows PowerShell 5.0 for .NET developers, speaker, blogger, Microsoft TechNet Wiki Ninja, and a fun-loving person. Chen V is a Powe...

Use PowerShell to maintain IIS logs
Aug 5, 2016
Post comments count 0
Post likes count 0

Use PowerShell to maintain IIS logs

Doctor Scripto
Doctor Scripto

Summary: Learn how to use PowerShell to maintain and work with IIS logs. Welcome back guest blogger, Terri Donahue. Here are Terri’s previous blog posts. Terri is a Senior Customer Support Engineer for Dynamicweb NA and a Visual Studio and Development Technologies MVP. Twitter: @terrid_dw Internet Information Services (IIS) log maintenance has been a thorn in the side of web administrators for a while…basically since the first release of IIS. There isn’t a built-in utility to handle file compression, archival of log files, or deletion of log files. Depending on a site’s traffic, these logs can grow quite big ve...

PowerTip: Use PowerShell to remove a user from all site collections in SharePoint Online
Jul 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to remove a user from all site collections in SharePoint Online

Doctor Scripto
Doctor Scripto

Summary: Learn how to use PowerShell to remove a corporate user from all site collections in SharePoint Online. How can I use Windows PowerShell to quickly remove a corporate user from all site collections in SharePoint Online? Use the following commands (change the login user name as required):

Manage your SharePoint Online tenant with PowerShell
Jul 27, 2016
Post comments count 0
Post likes count 0

Manage your SharePoint Online tenant with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to manage your SharePoint Online tenant installation by using Windows PowerShell cmdlets. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking, kite surfing, and spending time with his kids and dog. You can follow him on his blog at https://blogs.technet.microsoft.com/christwe/. Hello All, Continuing with the topic of how to use PowerShell to migrate a site collection fr...

The Scripting Guy: coming to a town near you
Jul 18, 2016
Post comments count 0
Post likes count 0

The Scripting Guy: coming to a town near you

I_am_mr_ed
I_am_mr_ed

SUMMARY: The Microsoft Scripting Guys, Ed Wilson, upcoming live appearances. Hello Scripters, Teresa (aka. Scripting Wife) here. We have been really busy recently working with PowerShell user groups, and we want to provide you with a convenient listing of upcoming special events. Hope we will be able to see you at one or more of the events. By the way, these events are filling up quickly, so you may want to sign up today. Here is the list: July:  July 19, 2016   Tampa FL  SharePoint User Group Meeting July 21, 2016    Tampa FL   Tampa PowerShell User Group  August: August 17, 2016  Basel Switzerland   Base...

Get started with PowerShell and SharePoint Online
Jul 15, 2016
Post comments count 0
Post likes count 0

Get started with PowerShell and SharePoint Online

Doctor Scripto
Doctor Scripto

Summary: Microsoft PFE Chris Weaver talks about getting started with Windows PowerShell and SharePoint Online. Welcome back Chris Weaver as guest blogger. You can see his previous guest blogs. Christopher Weaver is a Microsoft Premier Field Engineer (PFE) who focuses on SharePoint and Office 365 solutions for large enterprise Premier customers. He has been doing PowerShell and SharePoint with Microsoft for nine years. In his spare time, he enjoys backpacking, hiking, kite surfing, and spending time with his kids and dog. You can follow him on his blog. Hello All, I’ve put the kids to bed, the dog is snoring o...

PowerTip: Find all devices connected to a computer
Jul 14, 2016
Post comments count 0
Post likes count 0

PowerTip: Find all devices connected to a computer

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to find all devices that are connected to a computer. How can I use Windows PowerShell to list all devices that are connected to a computer? Use the Get-PnpDevice cmdlet and the -PresentOnly switch. Here is an example:

Passing through devices to Hyper-V VMs by using discrete device assignment
Jul 14, 2016
Post comments count 2
Post likes count 2

Passing through devices to Hyper-V VMs by using discrete device assignment

Doctor Scripto
Doctor Scripto

Summary: Learn how to attach a device from your Hyper-V host to your VM by using a new feature of Windows Server 2016. Today we have a guest blogger, Rudolf Vesely, who has blogged here on previous occasions. Here is a link to his previous posts if you would like to read them. Here is what Rudolf says about himself. I am an Azure Solutions Architect at Rackspace in London. I believe that public cloud is the future for most organizations and this is why I specialize in public clouds (Amazon Web Services and Azure) and hybrid cloud strategy. My unique role at Rackspace is to guide our customers in their cloud st...

PowerTip: Get the public IP of an Azure VM with PowerShell
Jul 1, 2016
Post comments count 3
Post likes count 0

PowerTip: Get the public IP of an Azure VM with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to get the public IP address of an Azure virtual machine.  How can I get the public IP address information for an Azure Resource Manager virtual machine (VM)? All you need to do is use Get-AzureRmVm to find the VM and pass it to Get-AzureRmPublicIPAddress as in the following example:

How to alter the public IP address of an Azure virtual machine
Jul 1, 2016
Post comments count 0
Post likes count 0

How to alter the public IP address of an Azure virtual machine

Doctor Scripto
Doctor Scripto

Summary: Change the public IP address in Azure Resource Manager by using Windows PowerShell. Honorary Scripting Guy, Will Anderson, shares a personal challenge that he encountered when working with Azure and public IP addresses. He also shares the solution with the rest of us! Take it away, Will! Recently, I incorrectly configured an Azure Resource Manager virtual machine (VM) in my lab environment and needed to make some changes to the public IP settings. A brief look around the Internet came up empty, so I thought I'd share the challenge and the solution to this puzzle with you. The challenge If we take a lo...

PowerTip: Get a GUI interface for any PowerShell cmdlet
Jun 30, 2016
Post comments count 0
Post likes count 0

PowerTip: Get a GUI interface for any PowerShell cmdlet

Doctor Scripto
Doctor Scripto

Summary: Use the Show-Command to build PowerShell cmdlets. I ran into a problem. Some cmdlets have too many parameters to list. Is there an easy way to build a cmdlet with its parameters for the console? You’ll love this trick! Just use the Show-Command cmdlet with any PowerShell cmdlet to get a GUI interface. In the following example, we use this with the Import-MDTDriver cmdlet. When you are done, you will have three options: Run, Copy (for the clipboard), or Cancel.

Find ready-to-use sample PowerShell scripts in the GUI
Jun 30, 2016
Post comments count 0
Post likes count 0

Find ready-to-use sample PowerShell scripts in the GUI

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney, goes over some often missed, easy-to-use PowerShell techniques for those who are starting out. I had heard a rumor that many of the management tools actually run PowerShell code in the backend. Is there any way to see what code it’s running? Honorary Scripting Guy, Sean Kearney, is here today, and, yes, it’s true. This hidden gem is one of the most frequently missed pieces by many people who use PowerShell. The GUI in many cases is calling up PowerShell. Let’s begin with something pretty simple: managing users in Active Directory and auditing groups. For me, tha...

PowerTip: List all available CIM classes by using PowerShell
Jun 29, 2016
Post comments count 0
Post likes count 0

PowerTip: List all available CIM classes by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Get-CimClass cmdlet to see all classes that you can query from. How can I find a list of Common Information Model (CIM) classes in Windows so that I can ask my computer useful questions? Just run the Get-CIMClass cmdlet to get a list of all available classes in the default namespace in Windows. If you’d like to filter on the list, you can use a wildcard. In the following example, we show all classes that begin with Win32 and have the word, Disk, in it. Get-CimClass Win32*Disk*

Use Windows PowerShell as an administrative console
Jun 29, 2016
Post comments count 0
Post likes count 0

Use Windows PowerShell as an administrative console

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney, shares his early use of PowerShell as a network administrator. I have a simple but irritating task each day around lunch time. A handful of people usually lock themselves out of Active Directory. Can you help me find an easy way to deal with this? Honorary Scripting Guy, Sean Kearney, is here to help you share the pain. I, too, once felt that prickly feeling on the back of my neck near the end of lunch hour. “Lock out Hell”, I called it. I know that everyone has experienced that, especially on Friday. A handful of people come in and for whatever reason have lock...

PowerTip: List all subfolders under a target path with PowerShell
Jun 28, 2016
Post comments count 0
Post likes count 0

PowerTip: List all subfolders under a target path with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Get-Childitem to provide a printable list of all folders under a path. I used to use tree.com to get a list of folders on a computer. Is there something close to that in PowerShell? Maybe something I could print? If you were to use Get-Childitem combined with Select-Object, you could get a pretty clean list. Here’s an example that targets drive c: and all hidden folders. It displays only directories and their full paths.

Erase files based on date by using PowerShell
Jun 28, 2016
Post comments count 0
Post likes count 0

Erase files based on date by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney, relates his first experience with PowerShell. I was curious just how difficult it is to use Windows PowerShell. For example, how difficult is it to erase files based on the current date? Honorary Scripting Guy, Sean Kearney, is here today, and I can completely relate to exactly what you’ve said. I once had absolutely zero time to learn about scripting or automation. I was a field technician. You know the typical work for some field techs. You get in the car, go to the call, hop back in the car, off to the next call, lunch in a drive-thru, sleep in a parking lot....

PowerTip: Use a destructive PowerShell cmdlet safely
Jun 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Use a destructive PowerShell cmdlet safely

Doctor Scripto
Doctor Scripto

Summary: Use the –whatif parameter with PowerShell cmdlets to test code live. I heard that PowerShell has a built-in safety switch to many of its cmdlets. Could you show me an example of it in use? No problem. You’re referring to the –whatif parameter, which is meant to show you what would happen if you used a PowerShell cmdlet without actually executing the cmdlet. An example of this in action is in the following Remove-Item cmdlet. This will attempt to remove the document, HSG-Article-Sean-Should-Not-Lose.docx, without actually removing it.

Use Windows PowerShell to search for files
Jun 27, 2016
Post comments count 2
Post likes count 4

Use Windows PowerShell to search for files

Doctor Scripto
Doctor Scripto

Summary: Use Get-Childitem to search the files system with PowerShell. I saved a file somewhere on my computer and can’t find it. Is there a way to use Windows PowerShell to find it? Honorary Scripting Guy, Sean Kearney, is here today to show you a cool trick I use all the time. I use PowerShell to search for things constantly! Why PowerShell? Well, to be honest, I have a bad, bad, bad habit of putting data where it shouldn’t be. Sometimes I’d use locations that the Indexer in Windows isn’t watching. In these situations, even Cortana can’t help me. We can use Get-Childitem to show a list of files and/or dir...

PowerTip: Remove trailing space from a string by using PowerShell
Jun 24, 2016
Post comments count 0
Post likes count 0

PowerTip: Remove trailing space from a string by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the trim() method to remove leading and trailing spaces from a string. Could you do me a huge favor and show me how to get rid of spaces before and after a string in PowerShell? No problem at all. All you need to do is apply the trim() method to remove all the output. You can also use trimstart() to remove the start or trimend() to remove the end. Here is an example: $Data=’           Look at all of this wasted space on my screen. $Data $Data.trim() $Data.trimstart() $Data.trimend()

Build a hexadecimal clock in PowerShell – Part 5
Jun 24, 2016
Post comments count 0
Post likes count 0

Build a hexadecimal clock in PowerShell – Part 5

Doctor Scripto
Doctor Scripto

Summary: Learn to split data in a Here-String and get a console beep. Honorary Scripting Guy, Sean Kearney, is here with our final day this week to wrap up building a hexadecimal clock in PowerShell. When we finished yesterday, we ran across a snag in our output. Most of our rows kept dropping to the immediate left of the screen as in the following image: For this, we will look at one of our Here-Strings to try and figure out the problem: If we look at a Here-String, you’ll notice it is literally a long string. It has an array count of 1 but a large length. The question is, how can I access the i...

PowerTip: Set the color of the progress bar with PowerShell
Jun 23, 2016
Post comments count 0
Post likes count 0

PowerTip: Set the color of the progress bar with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the $Host object to alter the color of the progress bar in PowerShell. I was curious if there’s a way to change the color of the progress bar in PowerShell. Do you know how this could be done? Glad you asked! You can do this by altering the values for ProgressBackGroundColor and ProgressForegroundColor under $Host.PrivateData. To change to a bright green background with a black foreground, use the following code in PowerShell: $Host.PrivateData.ProgressBackgroundColor=’Green’ $Host.PrivateData.ProgressForegroundColor=’Black’

Build a hexadecimal clock in PowerShell – Part 4
Jun 23, 2016
Post comments count 0
Post likes count 0

Build a hexadecimal clock in PowerShell – Part 4

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to navigate the neutral zone. Honorary Scripting Guy, Sean Kearney, is here today to continue forth (not COBOL nor even Visual BASIC) into our silly yet fun quest to build a hexadecimal clock by using the PowerShell console. It does seem silly, doesn’t it? Yet, consider some of the things that we’ve learned in PowerShell during our quest. So, although the quest seems silly, we have learned quite a bit. Actually, it's much like any quest. The goal isn’t the point. It’s what you learn or experience while getting there. Our next part is to figure out how to draw this silly thi...

PowerTip: Set a default value in a switch statement
Jun 22, 2016
Post comments count 0
Post likes count 0

PowerTip: Set a default value in a switch statement

Doctor Scripto
Doctor Scripto

Summary: Use the default field in switch statement to have an assumed value. I was playing with Select-String and would like to have it default to a value if none was trapped for. How can I do that? Just use the Default keyword, and you can have an assumed value in the script block. In the following example, the switch is listening for the $DogSeesSquirrel object. If no values match, it returns ‘Squirrel runs free’. { 'Back door' { $Response=’Bark!’} 'Couch'     { $Response=’Growl a bit.’} 'Food bowl' { $Response=’Bark! Bark! Bark!’} Default    { $Response=’Squirrel runs free’ } } My apologies to our little d...

Build a hexadecimal clock in PowerShell – Part 3
Jun 22, 2016
Post comments count 0
Post likes count 0

Build a hexadecimal clock in PowerShell – Part 3

Doctor Scripto
Doctor Scripto

Summary: Use Select-String in PowerShell to identify data and match it to an array. Honorary Scripting Guy, Sean Kearney, is here today to play more with our funky, nerdy, cool hexadecimal clock. Yesterday we built out a small function named Get-HexTime to give us the current time that displays hex digits instead of decimal for hours, minutes, and seconds. One of our challenges is going to be matching up the individual hex digits to our positions in the array. We can step through the list of characters in HexTime with a pretty simple loop: $Hextime=Get-Hextime For ($Count=0; $Count -lt ($HexTime.Length); $Coun...

PowerTip: Use PowerShell to identify a leap year
Jun 21, 2016
Post comments count 1
Post likes count 0

PowerTip: Use PowerShell to identify a leap year

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell and Math to identify a leap year. Is there a way to use PowerShell to identify whether this year is a leap year? Actually there is! You can use a combination of Get-date to find out the year and the Modulus function in PowerShell. If the value is zero, the current year is a leap year!

Build a hexadecimal clock in PowerShell – Part 2
Jun 21, 2016
Post comments count 0
Post likes count 0

Build a hexadecimal clock in PowerShell – Part 2

Doctor Scripto
Doctor Scripto

Summary: Manipulate string data from Get-Date in PowerShell. Honorary Scripting Guy, Sean Kearney, is here today to have a little more fun with our silly project to build a hexadecimal clock in the PowerShell console. Well, after all, who said scripting wasn’t allowed to be fun? That’s usually how I learn, by playing about! Yesterday, we defined a cool array of Here-Strings that contain all the characters that we’d like to display in our clock. Today, we’re going to access the properties of the current time and see how we could put that to use. The very first thing that we’ll need to do is pull up the date an...

PowerTip: Extend a string array in PowerShell
Jun 20, 2016
Post comments count 0
Post likes count 0

PowerTip: Extend a string array in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the built in features of PowerShell to easily add new Element to a string array. I created an array of strings in PowerShell, but I need to add to it. Is there a simple way to do this? Absolutely. Just use += to add an element to your string array. In the following example, we add a new element to the array that’s named $HSG

Build a hexadecimal clock in PowerShell – Part 1
Jun 20, 2016
Post comments count 0
Post likes count 0

Build a hexadecimal clock in PowerShell – Part 1

Doctor Scripto
Doctor Scripto

Honorary Scripting Guy, Sean Kearney, is here today, and I’m going to sit down and have some fun this week. Today I was feeling a bit bored and, for some reason, the thought “hexadecimal clock” entered my head. Don’t ask why because I’m not quite sure about the “Why” part. But, it just did. Then, I sat down and thought, what’s involved? Really? As a script, from a pseudo-code standpoint, it’s pretty simple Only I wanted this to be…well…b-i-g. In my head, I wanted a clock as wide as my console. That started my head spinning. “Big letters. How can I draw big letters and numbers?” In the “old world” ...

PowerTip: Export Azure resource group as JSON by using PowerShell
Jun 10, 2016
Post comments count 0
Post likes count 0

PowerTip: Export Azure resource group as JSON by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to export a resource group as a JSON configuration. I’ve heard that JSON is used to define features in Azure Resource Manager. Is there a way to export a resource group in JSON format? Just use the Export-AzureRMResourceGroup cmdlet and provide the resource group name. It will automatically save a JSON file that matches the resource group name in your current folder. Here is an example:

Create Azure Resource Manager virtual machines by using PowerShell – Part 5
Jun 10, 2016
Post comments count 0
Post likes count 0

Create Azure Resource Manager virtual machines by using PowerShell – Part 5

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to assign credentials and create the virtual machine. This blog post is part of a series about how to create Azure Resource Manager virtual machines by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to start with the two series that precede this series: Now that I’ve built all the objects for the virtual machine (VM), what’s left before we spin up the machine in Azure Resource Manager? Honorary Scripting Guy, Sean Kearney, is here to finish up our three-week session abo...

PowerTip: Search Azure Resource Manager image publishers by using PowerShell
Jun 9, 2016
Post comments count 0
Post likes count 0

PowerTip: Search Azure Resource Manager image publishers by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to search publishers for a match. Could you show me an example of how to search through the list of publishers for Azure images? Just use the Get-AzureRMVMImagePublisher cmdlet, and filter on the PublisherName property. The following example searches for all publishers that contain the name, Windows.

Create Azure Resource Manager virtual machines by using PowerShell – Part 4
Jun 9, 2016
Post comments count 0
Post likes count 0

Create Azure Resource Manager virtual machines by using PowerShell – Part 4

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to select the operating system image for a virtual machine. This blog post is part of a series about how to create Azure Resource Manager virtual machines by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to start with the two series that precede this series: I’ve got most of that virtual machine (VM) assembled, but I was having quite a time trying to pull together the operating system image with PowerShell. Nudge me in the right direction, could you? Honorary Scripting...

PowerTip: Change current Azure Resource Manager subscription by using PowerShell
Jun 8, 2016
Post comments count 0
Post likes count 0

PowerTip: Change current Azure Resource Manager subscription by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to alter the current active subscription in use. I have about a dozen different subscriptions in my Azure Resource Manager account. How can I change it from the default one to one of my others? You can do this very task by using the Select-AzureRMSubscription cmdlet and providing either the name of the subscription or the SubscriptionId (which is probably more accurate). Here are examples: *or*

Create Azure Resource Manager virtual machines by using PowerShell – Part 3
Jun 8, 2016
Post comments count 0
Post likes count 0

Create Azure Resource Manager virtual machines by using PowerShell – Part 3

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to create and attach a virtual network card to a virtual machine. This blog post is part of a series about how to create Azure Resource Manager virtual machines by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to start with the two series that precede this series: I’m trying to find some guidance about how to use PowerShell to create a virtual network card. Would you be so kind as to lend me a hand? Honorary Scripting Guy, Sean Kearney, is here today continuing forth (...

PowerTip: Get the time and date as a string of numbers by using PowerShell
Jun 7, 2016
Post comments count 0
Post likes count 0

PowerTip: Get the time and date as a string of numbers by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the –format option in Get-Date to change the output. I’d like to build some log files and have the date and time as part of the name. Is there a way to show the date and time in a format where it’s all numbers? Absolutely! Just use the –format option with Get-Date and supply a format for the output. To see the format as month, day, year, hour, minutes, and seconds, use this example:

Create Azure Resource Manager virtual machines by using PowerShell – Part 2
Jun 7, 2016
Post comments count 0
Post likes count 0

Create Azure Resource Manager virtual machines by using PowerShell – Part 2

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to define the operating system disk on a storage blob for a virtual machine. This blog post is part of a series about how to create Azure Resource Manager virtual machines by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to start with the two series that precede this series: Would you help me, please?  I need to know how to define storage for my virtual machine in Azure Resource Manager by using PowerShell.  Honorary Scripting Guy, Sean Kearney, is here as we happily go...

PowerTip: Find available virtual machine size by using PowerShell
Jun 6, 2016
Post comments count 0
Post likes count 0

PowerTip: Find available virtual machine size by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to get the proper name for a virtual machine size. Is there a way to see the proper name for a virtual machine size without creating a virtual machine first? Just use the Get-AzureRMVMSize cmdlet, and filter on the Name property. You just need to supply a location first. In this example, we are looking at available sizes in the ‘eastus’ location that have ‘S2’ in the name.

Create Azure Resource Manager virtual machines by using PowerShell – Part 1
Jun 6, 2016
Post comments count 0
Post likes count 0

Create Azure Resource Manager virtual machines by using PowerShell – Part 1

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell cmdlets to start to create a virtual machine in Azure Resource Manager. This blog post is part of a series about how to create Azure Resource Manager virtual machines by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to start with the two series that precede this series: How do I create virtual machines (VMs) in Azure Resource Manager by using PowerShell? Where do I start? Honorary Scripting Guy, Sean Kearney, is here, and we’re going to give you some basic step-by-step guidance this week abou...

PowerTip: List all virtual network subnets by using PowerShell
Jun 3, 2016
Post comments count 0
Post likes count 0

PowerTip: List all virtual network subnets by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to identify all the available subnets in a particular virtual network. I’m trying to figure out a way to list all the subnet configurations in a virtual network in Azure Resource Manager. Got any tips? How about the answer? It’s a matter of combining the Get-AzureRMVirtualNetwork cmdlet and Get-AzureRMVirtualNetworkSubnetConfig. Here is an example:

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 5
Jun 3, 2016
Post comments count 0
Post likes count 0

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 5

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to retrieve Azure Resource Manager virtual machine properties. This blog post is part of a series about how to retrieve Azure Resource Manager virtual machine properties by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to first read the preceding five-part series about how to work with Azure Resource Manager cmdlets. After you finish this series, move on to the next series to learn more about the Azure Resource Manager cmdlets. There’s one thing I couldn’t figure out that I really need your help...

PowerTip: List all Azure Resource Manager storage accounts by using PowerShell
Jun 2, 2016
Post comments count 0
Post likes count 0

PowerTip: List all Azure Resource Manager storage accounts by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to identify available storage accounts. I’m working a client site, and they’d like me to document the configuration of their Azure Resource Manager environment. I’m in desperate need of a list of the storage accounts. Help me, please? One cmdlet and you’re done. Just use the Get-AzureRMStorageAccount cmdlet. If you run this, you’ll only get the list, but you can export it to a .csv file named StorageAccounts.csv. Here is an example:

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 4
Jun 2, 2016
Post comments count 0
Post likes count 0

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 4

Doctor Scripto
Doctor Scripto

Summary: Find storage groups by using PowerShell. This blog post is part of a series about how to retrieve Azure Resource Manager virtual machine properties by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to first read the preceding five-part series about how to work with Azure Resource Manager cmdlets. After you finish this series, move on to the next series to learn more about the Azure Resource Manager cmdlets. Could you lend me a hand? I’m trying to find properties, like the current storage group that a virtual ma...

PowerTip: List Azure Resource Manager resources assigned to a resource group by using PowerShell
Jun 1, 2016
Post comments count 0
Post likes count 0

PowerTip: List Azure Resource Manager resources assigned to a resource group by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to show resources that are assigned under a resource group. I looked at the console for Azure Resource Manager and can see all the resources for a particular resource group. Is there a way to see that by using PowerShell? There sure is! Just use the Get-AzureRMResource cmdlet and filter on the ResourceGroupName property. Here’s an example:  

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 3
Jun 1, 2016
Post comments count 0
Post likes count 0

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 3

Doctor Scripto
Doctor Scripto

Summary: Identify properties for the operating system of a virtual machine. This blog post is part of a series about how to retrieve Azure Resource Manager virtual machine properties by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to first read the preceding five-part series about how to work with Azure Resource Manager cmdlets. After you finish this series, move on to the next series to learn more about the Azure Resource Manager cmdlets. Can you show me how to identify the properties for the operating system so that...

PowerTip: Get Azure Virtual Machine Diagnostics by using PowerShell
May 31, 2016
Post comments count 0
Post likes count 0

PowerTip: Get Azure Virtual Machine Diagnostics by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to retrieve diagnostic data within Azure Resource Manager virtual machines.  Our QA department was asking a very specific question that I didn’t know how to answer. Is there anything in an Azure virtual machine (VM) to show the quality of the boot and its startup?  Maybe this will help. You can access the boot diagnostics data with a single cmdlet. To retrieve the data for a single machine, use the Get-AzureRmVMBootDiagnosticsData cmdlet and add a parameter to target whether the machine is a Windows VM or Linux VM. Here is an example:

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 2
May 31, 2016
Post comments count 0
Post likes count 0

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 2

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to get the machine size from a virtual machine. This blog post is part of a series about how to retrieve Azure Resource Manager virtual machine properties by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to first read the preceding five-part series about how to work with Azure Resource Manager cmdlets. After you finish this series, move on to the next series to learn more about the Azure Resource Manager cmdlets.  I remember that yesterday we created a virtual machine (VM)...

PowerTip: Show Azure Resource Manager virtual machine status with PowerShell
May 30, 2016
Post comments count 0
Post likes count 0

PowerTip: Show Azure Resource Manager virtual machine status with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the Azure Resource Manager cmdlets to see the running state of a virtual machine.  I remember using the old cmdlets for Azure, and they would show the status of my virtual machines.  How can I do that with the new cmdlets?  Use the Get-AzureRM cmdlet with the –Status parameter to expand the available properties. Here’s a simple example to pull the statuses of a virtual machine: Here is an example:

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 1
May 30, 2016
Post comments count 0
Post likes count 0

Retrieve Azure Resource Manager virtual machine properties by using PowerShell – Part 1

Doctor Scripto
Doctor Scripto

Summary: Use the Azure Resource Manager cmdlets to create a virtual machine. This blog post is part of a series about how to retrieve Azure Resource Manager virtual machine properties by using PowerShell. To get the most out of this series, read the posts in order. If you’re new to PowerShell, you might want to first read the preceding five-part series about how to work with Azure Resource Manager cmdlets. After you finish this series, move on to the next series to learn more about the Azure Resource Manager cmdlets.  I was curious about something. Could you show me a simple example to create a ...

PowerTip: List Azure Resource Manager virtual networks with PowerShell
May 27, 2016
Post comments count 0
Post likes count 0

PowerTip: List Azure Resource Manager virtual networks with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the AzureRM cmdlets to list all available virtual networks in a subscription.  I’m doing work for a client who forgot to give me a list of the virtual networks in the client's Azure subscription. Could you save me some time and show me how to get that list?  Just use the Get-AzureRMVirtualNetwork cmdlet. This will dump the output to the screen in a long list. If you’d like something more readable, such as the name, location and the subnet that it controls, try this one liner:

Work with the Azure Resource Manager cmdlets – Part 5
May 27, 2016
Post comments count 0
Post likes count 0

Work with the Azure Resource Manager cmdlets – Part 5

Doctor Scripto
Doctor Scripto

Summary: Here's how to use PowerShell to create a virtual network and a network security group. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.  I’ve heard that networking is far more powerful in Azure Resource Manager. Could you take a few minutes to show me how to use PowerShell to set up a basic network for virtual machines (VMs) in Azure?  Honorary Scripting Guy, Sean K...

PowerTip: View properties from a storage account with PowerShell
May 26, 2016
Post comments count 0
Post likes count 0

PowerTip: View properties from a storage account with PowerShell

Doctor Scripto
Doctor Scripto

Summary: View and access the SKU from a storage account for future use.  I went to work with the New-AzureRMStorageAccount cmdlet but was confused about how to know which name to use for the SKU. Is there an easy way to know which one to use?  There most certainly is! Just create your storage account in the Azure portal first. Then you use the Get-AzureRMStorageAccount cmdlet to access the SKU property. Here is an example to access ‘hsgstorageaccount’.

Work with the Azure Resource Manager cmdlets – Part 4
May 26, 2016
Post comments count 0
Post likes count 0

Work with the Azure Resource Manager cmdlets – Part 4

Doctor Scripto
Doctor Scripto

Summary: Learn how to use PowerShell to create storage accounts. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.  Now that we know how to create resource groups, what is our next step to prepare the Azure Resource Manager infrastructure for virtual machines (VMs)?  Honorary Scripting Guy, Sean Kearney, is here today with a wee bit more PowerShell for your Azure Resource Man...

PowerTip: Get all Azure Resource Manager resource groups with PowerShell
May 25, 2016
Post comments count 1
Post likes count 0

PowerTip: Get all Azure Resource Manager resource groups with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Using the AzureRM cmdlets to get a list of resource groups.  I have a client who has a large list of resource groups. Can you show me how to get a filtered list?  Just use the Get-AzureRMResourceGroup cmdlet and pipe the results to Where-Object. To identify all resource groups that start with HSG in the name, try this;

Work with the Azure Resource Manager cmdlets – Part 3
May 25, 2016
Post comments count 0
Post likes count 0

Work with the Azure Resource Manager cmdlets – Part 3

Doctor Scripto
Doctor Scripto

Summary: Create and access resource groups with the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.  I’m happily sitting here logged into Azure with the AzureRM cmdlets and would like to start with resource groups.  Could you show me where to start?  Honorary Scripting Guy, Sean Kearney, is here again. Yesterday we discovered how to automate authentication ...

PowerTip: Get a list of all subscriptions in your Azure Resource Manager account
May 24, 2016
Post comments count 0
Post likes count 0

PowerTip: Get a list of all subscriptions in your Azure Resource Manager account

Doctor Scripto
Doctor Scripto

Summary: Use the Get-AzureRMSubscription cmdlet.  How can I see all of the available subscriptions when I am logged into Azure Resource Manager?  Just run the Get-AzureRMSubscription cmdlet to get a complete list available to your UserID. Get-AzureRMSubscription

Work with the Azure Resource Manager cmdlets – Part 2
May 24, 2016
Post comments count 0
Post likes count 0

Work with the Azure Resource Manager cmdlets – Part 2

Doctor Scripto
Doctor Scripto

Summary: Authenticate to Azure with the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.  I’ve got the new AzureRM cmdlets installed, but I’m just not sure where to start! Could you give me a nudge in the right direction?  Honorary Scripting Guy, Sean Kearney, is here to help you out. The first real piece you need is to get authenticated to Azure Resource Ma...

PowerTip: Find a module in the PowerShell Gallery
May 23, 2016
Post comments count 0
Post likes count 1

PowerTip: Find a module in the PowerShell Gallery

Doctor Scripto
Doctor Scripto

Summary: Use the PowerShell Find module to search for modules.  I was trying to use the Find-module. Can you show me how to find all modules that have the word, Azure, in them?  Just use a wildcard in the search like in the following example to return modules with the name Azure in the beginning:

Work with the Azure Resource Manager cmdlets – Part 1
May 23, 2016
Post comments count 0
Post likes count 0

Work with the Azure Resource Manager cmdlets – Part 1

Doctor Scripto
Doctor Scripto

Summary: Obtain and install the AzureRM cmdlets. This blog post is part of a series about how to work with the Azure Resource Manager cmdlets. To get the most out of this series, read the posts in order. After you finish this series, move on to the next two series to learn more about the Azure Resource Manager cmdlets.  I heard Microsoft introduced some new cmdlets to work with Azure Resource Manager.   Could you show me how I could install them?  Honorary Scripting Guy, Sean Kearney, is here today to introduce you to the newest cmdlets to manage the Azure Resource Manager environment. Most o...

The Scripting Guys and Scripting Wife summer tour
May 16, 2016
Post comments count 0
Post likes count 0

The Scripting Guys and Scripting Wife summer tour

I_am_mr_ed
I_am_mr_ed

SUMMARY: Ed Wilson talks about his summer of PowerShell tour with dates and links to live appearances. Hello everyone,  Hope you are having a fantastic day. Ed and I have been busy as usual and are ready to get busier.  Here are the dates and links to upcoming events we will be attending and Ed speaking. There is a trip to Europe that some items are planned and have a link and others that are on the planning board. We will post links as they are available but for now I will just reference the city/country and for the link I will just write to be determined. Hope to see you at one of these events.   May 23...

The top three tips for effective sorting in PowerShell
May 3, 2016
Post comments count 0
Post likes count 0

The top three tips for effective sorting in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn the top three tips to effectively use Windows PowerShell to sort data in this blog post by the Microsoft Scripting Guy, Ed Wilson. One of the fundamental things that I need to do when I look at any kind of data is sort it so that I can make sense of what I am looking at. It doesn’t matter if I am looking at Yelp for restaurant recommendations (I want to sort by distance from me and by average rating) or at my Facebook timeline (I want to sort by time, as in, when an update was posted). Yes, sorting is one thing that makes the difference between, say, looking for books at the library via the online...

PowerTip: Specify that a script requires admin privileges to run
Apr 25, 2016
Post comments count 0
Post likes count 0

PowerTip: Specify that a script requires admin privileges to run

Doctor Scripto
Doctor Scripto

Summary: Learn how to require admin privileges to run a Windows PowerShell script.  How can I make sure that my Windows PowerShell script has administrator privileges to run?  Use the #Requires directive and specify RunAsAdministrator. Here is an example:

How to answer a technical question: A guide for presenters
Apr 25, 2016
Post comments count 0
Post likes count 0

How to answer a technical question: A guide for presenters

Doctor Scripto
Doctor Scripto

Summary: Learn how to properly answer a technical question in a presentation in this step-by-step post by PowerShell MVP June Blender. Today we have another blog post by PowerShell MVP June Blender. June is an Honorary Scripting Guy and a technical evangelist for the SAPIEN Technologies, Inc. She has been working with PowerShell for a long time. When she worked for Microsoft, she wrote the PowerShell help documentation. If you have ever used Get-Help in your life, more than likely you have seen some of her work. Take it away June … How to Answer a Technical Question Like many people, I look forward to the Power...

Use a script block to create custom groupings in PowerShell
Apr 19, 2016
Post comments count 0
Post likes count 0

Use a script block to create custom groupings in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use a script block with the Group-Object cmdlet in Windows PowerShell to create custom groupings in this article by Microsoft Scripting Guy Ed Wilson. Good morning. Ed Wilson the Microsoft Scripting Guy is here. This week, I have been hanging out with a group of writers. It has been both fun and educational. It is always good to see how other people solve standard types of problems. As I look around, I can see nearly a dozen other writers huddled into little conversation groups as they discuss problems of craft. Anyway, with Windows PowerShell, there are also standard problems of craft wit...

Discover relationships by using Group-Object in PowerShell
Apr 18, 2016
Post comments count 0
Post likes count 0

Discover relationships by using Group-Object in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use one of the most basic Windows PowerShell cmdlets, the Group-Object cmdlet, to see relationships among different objects. There are some things in life that just seem to always go together: jasmine flowers and green tea, scones and English breakfast tea, or even peanut butter and apples. In the world of Windows PowerShell, there are things that go together as well. It seems that I always do the same kinds of things: For the next few days, I want to focus on the second and third items, grouping data and sorting data. Group-Object: A basic cmdlet No matter what I am doing with Wi...

PowerTip: Use PowerShell to display a percentage that has two decimal places
Apr 17, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to display a percentage that has two decimal places

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display a percentage as a two place number.  How can I use Windows PowerShell to display a number as a percentage that has two decimal places?  Use the -f format specifier, and specify a pattern as “{0:p2}”. On the other side of the -f format specifier, perform your percentage calculation. Here is an example: PS C:\> "{0:p2}" -f (1/10) 10.00 %

PowerTip: Use a regular expression pattern to remove nonalphabetic characters
Apr 15, 2016
Post comments count 0
Post likes count 0

PowerTip: Use a regular expression pattern to remove nonalphabetic characters

Doctor Scripto
Doctor Scripto

Summary: Learn how to use a regular expression pattern to remove non-alphabetic characters from a string by using Windows PowerShell.  How can I use Windows PowerShell to remove non-alphabetic characters from a string?  To remove nonalphabetic characters from a string, you can use the -Replace operator and substitute an empty string ‘’ for the nonalphabetic character. The secret to doing this is to create a pattern on characters that you want to include and then using the not (^) in the series symbol. Here is an example: $string = 'abcdefg12345HIJKLMNOP!@#$%qrs)(*&^TUVWXyz' $pattern = '[^a-zA-Z]' $string -re...

Additional resources for text analysis by using PowerShell
Apr 15, 2016
Post comments count 0
Post likes count 0

Additional resources for text analysis by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: This is a summary of some of the additional resources for working with text and Windows PowerShell. Good day. Microsoft Scripting Guy, Ed Wilson, is here. So, here's the deal. We are going along and decide to write a simple Windows PowerShell script. Before we know it, the thing has morphed into dozens of lines. And, also before we know it, we quickly find ourselves in the weeds. It begins like a day at the beach, perhaps like the one here. And suddenly, before we know it, we are in the weeds, look around and, lo and behold, alligators. Dude! And, all of a sudden, we are feeling as exposed as a bu...

Calculate percentage character frequencies from a text file by using PowerShell
Apr 14, 2016
Post comments count 0
Post likes count 0

Calculate percentage character frequencies from a text file by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to calculate the percentage of how often a character appears in a text file. This is the fifth post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the series: Okay, I will admit that I am just playing around, but I wanted to calculate the percentages of letter frequencies in a text file. For this example, I am using A Tale of Two Cities as a text file. You should refer to earlier blog articles about this ...

Compare the letter frequency of two text files by using PowerShell
Apr 13, 2016
Post comments count 0
Post likes count 0

Compare the letter frequency of two text files by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to compare the letter frequency of two different text files. This is the fourth post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the series: One thing that is kind of cool is that with Windows PowerShell you can do all kinds of stuff and never have to write a script. This also means that it is easy to forget your scripting skills after a few years of never writing scripts. You may say, "WOOHOO!!!" But,...

Read a text file and do frequency analysis by using PowerShell
Apr 12, 2016
Post comments count 0
Post likes count 0

Read a text file and do frequency analysis by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to read a text file and do a letter-frequency analysis using Windows PowerShell in this article written by the Microsoft Scripting Guy, Ed Wilson. This is the third post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the series: Today I am going to put the script I wrote yesterday together with the script that I wrote on Friday. After I do that, I will be able to get a more accurate letter-frequency analysis of a text file. The co...

How to skip the beginning and ending of a file by using PowerShell
Apr 11, 2016
Post comments count 0
Post likes count 1

How to skip the beginning and ending of a file by using PowerShell

I_am_mr_ed
I_am_mr_ed

Summary: Learn how to skip the beginning and ending portions of a text file by using Windows PowerShell in this article by the Microsoft Scripting Guy Ed Wilson. This is the second post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the series: Good morning, Microsoft Scripting Guy Ed Wilson is here. At this very moment, the Scripting Wife (PowerShell MVP Teresa Wilson) and I are heading back to Central Florida after an absolutely incredible week in...

Letter frequency analysis of text by using PowerShell
Apr 8, 2016
Post comments count 0
Post likes count 0

Letter frequency analysis of text by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to do letter frequency analysis of a text enabling one to see how often a letter occurs. This is the first post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the series: So, the other night I was watching a show about cryptography. In the episode, the moderator said that all forms of encryption involve some form or type of letter substitution, and they went back over ...

PowerShell 5 MVA coming soon to a computer near you
Apr 6, 2016
Post comments count 0
Post likes count 0

PowerShell 5 MVA coming soon to a computer near you

I_am_mr_ed
I_am_mr_ed

SUMMARY: Microsoft Scripting Guy, Ed Wilson talks about recording a new Microsoft Virtual Academy series of videos with PFE Ashley McGlone. Hello everyone, Microsoft Scripting Guy Ed Wilson here. Well, I can tell you this week has been absolutely incredible. The Scripting Wife and I are out in Seattle (Bellevue, Redmond, Puget Sound ... whatever region) for the PowerShell Dev/Ops summit. This sold out event has been awesome ... and it is not over yet. With more than 150 PowerShellers from around the world, the electricity, the buzz, the overall awesomeness factor is rocking. Well, anyway, Microsoft PFE Ashley M...

PowerTip: Create a nested PowerShell custom object
Apr 5, 2016
Post comments count 0
Post likes count 1

PowerTip: Create a nested PowerShell custom object

Doctor Scripto
Doctor Scripto

Summary: Learn how to create a nested PowerShell custom object.  How do I create a nested PowerShell custom object to store layers (nested) of information? Use a hashtable with the PSCustomObject type accelerator, and specify PSCustomObject as the value to the Property Name (Key): [PSCustomObject]@{ PropertyName = [PSCustomObject]@{ NestedPropertyName = ‘NestedPropertyValue’ } }

Next steps for the official PowerShell documentation
Apr 4, 2016
Post comments count 0
Post likes count 0

Next steps for the official PowerShell documentation

Doctor Scripto
Doctor Scripto

Summary: Learn about changes that we’ve already made for PowerShell content and what’s planned for the near future. Hello scripters! My name is Don Gill, and I am the new documentation manager for Windows PowerShell. With the 2016 PowerShell and DevOps Summit quickly approaching, I thought it would be a fantastic opportunity to introduce myself to the PowerShell community and share some changes that we are putting in place to help you stay more connected with the PowerShell development team, share your feedback and suggestions, and even contribute directly to improving the PowerShell documentation. While I am ...

Use PowerShell 5.0 to create temporary files in the temp folder
Mar 31, 2016
Post comments count 0
Post likes count 0

Use PowerShell 5.0 to create temporary files in the temp folder

I_am_mr_ed
I_am_mr_ed

Summary: Microsoft Scripting Guy Ed Wilson talks about using Windows PowerShell 5.0 on Windows 10 to create temporary files in the temporary folder.   Sometimes it is the little things that make life easier. You know, like a cereal bar … it’s not like a major technological breakthrough but it is much more convenient than getting a bowl of milk and opening a box of cereal and dumping it in the bowl. Or a peanut butter cup is easier to use than getting two bars of chocolate and a jar of peanut butter … neater too. Well in Windows PowerShell 5.0 there are lots of these stealth features that make life easier ...

Use PowerShell 5 to empty the recycle bin
Mar 30, 2016
Post comments count 0
Post likes count 0

Use PowerShell 5 to empty the recycle bin

I_am_mr_ed
I_am_mr_ed

Summary: Microsoft Scripting Guy Ed Wilson talks about using Windows PowerShell 5.0 to empty the recycle bin on Windows 10   It seems that now days when I talk to someone about Windows PowerShell 5.0 they get all excited and go on and on about Desired State Configuration (DSC). Now, I will agree, DSC is awesome. DSC rocks! Even on Windows PowerShell 4.0 DSC was great, but on Windows PowerShell 5.0 it is even better. But … and this is huge … but, there is so much more in Windows PowerShell 5.0 than simply improvements to DSC. In fact, there is lots and lots of stuff in Windows PowerShell 5.0 that have been...

Using the new PowerShell ISE transcript tool
Mar 29, 2016
Post comments count 0
Post likes count 0

Using the new PowerShell ISE transcript tool

I_am_mr_ed
I_am_mr_ed

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the new Windows PowerShell 5.0 ISE Transcript tool.   One of my favorite features for Windows PowerShell has always been the transcript tool. I mean, it seems like it was made for Windows PowerShell … I guess it was. What am I talking about? Well, one of my favorite ways to spend time is plugging in various Windows PowerShell commands to see what they might do. Then I try to shorten them, make them leaner, or more powerful, or modify them to better suit my needs. Back when I used to do this on other systems, I would end up copying the command, ...

PowerTip: Find your version of PowerShell
Mar 14, 2016
Post comments count 0
Post likes count 0

PowerTip: Find your version of PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to find your Windows PowerShell version easily.  How can I use Windows PowerShell to tell me what version of Windows PowerShell I am running?  Use the $PsVersionTable automatic variable. To see the major, minor, build, and revision of Windows PowerShell, use the following: $PSVersionTable.PSVersion  

Control management pack updates between MS OMS and Operations Manager
Mar 14, 2016
Post comments count 0
Post likes count 0

Control management pack updates between MS OMS and Operations Manager

Doctor Scripto
Doctor Scripto

Summary: Learn how to disable automatic management pack updates from MS OMS to Operations Manager and limit updates to a specific time window. Hi all, Brian Wren here. I usually spend my time writing documentation for TechNet and Azure.com, but I’ve been hearing about an issue from a few customers that I wanted to address. We’re going to get some detailed documentation out on this, but a quick blog entry should suffice in the meantime. When you connect a management group in System Center Operations Manager (SCOM) to Log Analytics in Operations Management Suite (OMS), several management packs are automatically i...

For the love of Pi
Mar 14, 2016
Post comments count 0
Post likes count 0

For the love of Pi

Doctor Scripto
Doctor Scripto

Summary: In honor of Pi Day today, we have a guest blog post written by PowerShell MVP, Doug Finke. It's that time of year again when lovers of math, geometry, Albert Einstein, food, and Windows PowerShell can stop and reflect on that transcendental irrational number, Pi. It's the ratio of a circle's circumference to its diameter or "Hey, can I get a slice of that Pi?". Approximate Pi The best we can do is approximate Pi, 22/7 (go ahead, type that into a PowerShell console). The first recorded algorithm for rigorously calculating the value of π was a geometrical approach using polygons, which was devised aroun...

PowerTip:  Use PowerShell to configure BranchCache to run in local mode
Mar 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to configure BranchCache to run in local mode

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to configure BranchCache to run in local caching mode.  How can I use Windows PowerShell to configure BranchCache to run in local caching mode?  Open Windows PowerShell in an elevated prompt, and use the Enable-BCLocal cmdlet. Here is an example: Enable-BCLocal

PowerTip: Configure a client to listen for content requests by using PowerShell when powered on battery
Mar 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Configure a client to listen for content requests by using PowerShell when powered on battery

Doctor Scripto
Doctor Scripto

Summary: Learn how to configure a client to listen for content discovery requests even when running on battery with Windows PowerShell.  How can I use Windows PowerShell to configure a client to listen for content discovery requests even when my computer's running on battery?  Open Windows PowerShell with elevated permissions, and use the Enable-BCServeOnBattery cmdlet. Here is an example: Enable-BCServeOnBattery    

PowerTip: Use PowerShell to dismount a disk image
Mar 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to dismount a disk image

Doctor Scripto
Doctor Scripto

Summary:  Learn how to use Windows PowerShell to dismount a virtual disk or ISO.  How can I use Windows PowerShell to dismount a virtual disk?  Use the Dismount-DiskImage cmdlet. It will dismount either an ISO or a virtual hard disk. Specify the path then using -imagepath. Here is an example: Dismount-DiskImage -imagepath “C:\fso\myisodisk.iso”

PowerTip: Use PowerShell to disconnect virtual disk
Feb 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to disconnect virtual disk

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to disconnect from a virtual disk.  How can I use Windows PowerShell to disconnect from a virtual disk?  Use the Disconnect-VirtualDisk cmdlet and specify the friendly name, for example: Disconnect-VirtualDisk -FriendlyName VirtualDisk01

PowerTip: Disconnect sessions to ISCSI target with PowerShell
Feb 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Disconnect sessions to ISCSI target with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to disconnect sessions to a specified ISCSI target with Windows PowerShell.  How can I use Windows PowerShell to disconnect sessions to a ISCSI target object?  Use the Get-ISCSITarget cmdlet to retrieve the target, and then supply it as a node address for Disconnect-ISCSITarget, for example: Get-IscsiTarget $Tar = Get-IscsiTarget Disconnect-IscsiTarget -NodeAddress $Tar.NodeAddress

PowerTip: Enable and disable ODBC performance counter settings with PowerShell
Feb 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Enable and disable ODBC performance counter settings with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting.  How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters?  You can store a returned object for later use when you enable the performance counters by using the -PassThru parameter, for example: $perfCounter = Enable-OdbcPerfCounter -Platform 32-bit -PassThru <Execute some ODBC applications that are using ODBC pooling> Disable-OdbcPerfCounter $perfCounter

PowerTip: Enable PerfMon counters for ODBC connection pooling with PowerShell
Feb 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Enable PerfMon counters for ODBC connection pooling with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to enable Windows Performance Monitor counters for ODBC connection pooling.  How can I use Windows PowerShell to enable Windows Performance Monitor (PerfMon) counters so I can troubleshoot Open Database Connectivity (ODBC) connection pooling?  Use the Enable-ODBCPerfCountger cmdlet and specify the platform (32 bit or all). Here is an example: Enable-OdbcPerfCounter -Platform 32-bit

PowerTip: Use PowerShell to disable constrained delegation
Feb 26, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to disable constrained delegation

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to disable constrained delegation.  How can I use Windows PowerShell to disable constrained delegation authorization so that a user who is remotely connected to a SMB server cannot configure resources?  Use the Disable-SmbDelegation cmdlet, and specify the client and the SMB server, for example: Disable-SmbDelegation –SmbServer "FileServer01" –SmbClient "HVSVR01"  

PowerTip: Use PowerShell to disable all scheduled tasks in folder
Feb 26, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to disable all scheduled tasks in folder

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to disable all scheduled tasks in a specific folder.  How can I use Windows PowerShell to disable all scheduled tasks in a particular folder?  Use the Get-ScheduledTask cmdlet to enumerate the scheduled tasks in the folder, and then pipe the objects to the Disable-ScheduledTask cmdlet, for example: Get-ScheduledTask -TaskPath "\UpdateTasks\" | Disable-ScheduledTask

PowerTip: Use PowerShell to disable scheduled task
Feb 25, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to disable scheduled task

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to disable a scheduled task.  How can I use Windows PowerShell to disable a scheduled task?  Use the Disable-ScheduledTask cmdlet and specify the task name, for example: Disable-ScheduledTask -TaskName "SystemScan"

PowerTip: Disable plug and play device with PowerShell
Feb 25, 2016
Post comments count 0
Post likes count 0

PowerTip: Disable plug and play device with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to disable a plug and play device with Windows PowerShell.  How can I use Windows PowerShell to disable a plug and play device?  Use the Disable-PNPDevice cmdlet and specify the instance ID, for example: Disable-PnpDevice -InstanceID  'USB\VID_5986&;PID_0266&;MI_00\7&;1E5D3568&;0000'

PowerTip: Find DSC resources with PowerShell
Feb 24, 2016
Post comments count 0
Post likes count 0

PowerTip: Find DSC resources with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to find DSC resources with Windows PowerShell.  How can I use Windows PowerShell to find DSC resources that are available in the PowerShell Gallery?  Use the Find-DSCResource command.  

Overview of the PowerShellGet module to find scripts
Feb 23, 2016
Post comments count 0
Post likes count 0

Overview of the PowerShellGet module to find scripts

Doctor Scripto
Doctor Scripto

Summary: In this blog post, I provide a quick overview of the PowerShellGet module and its various commands. Believe it or not, the Windows PowerShell Saturday event in Tampa, Florida is coming up pretty quickly. There are still some tickets available, but they have been going pretty quickly lately. There are some awesome speakers coming to Tampa for this event and I am looking forward to seeing all of them. Something really cool is that Ashley McGlone is coming from Columbus, Ohio for the event. I was his mentor for a couple of years, and it is really great to see how successful he has become. In fact, we are g...

PowerTip: Find PowerShell modules that are installed by PowerShell Get command
Feb 22, 2016
Post comments count 0
Post likes count 1

PowerTip: Find PowerShell modules that are installed by PowerShell Get command

Doctor Scripto
Doctor Scripto

Summary: Learn how to find modules that were installed by the Windows PowerShell Get command.  How can I use Windows PowerShell to find modules that have been installed by the Get command?  Use the Get-InstalledModule command.

PowerShell Spotlight: February 2016
Feb 22, 2016
Post comments count 0
Post likes count 0

PowerShell Spotlight: February 2016

Doctor Scripto
Doctor Scripto

Summary: Microsoft MVP, Teresa Wilson, talks about Windows PowerShell Saturday in this month’s PowerShell Spotlight. Hello scripters, I hope everyone had a marvelous weekend and is planning on an awesome week. I have been working on some of the last of the preparations for PowerShell Saturday #010 coming up in less than a month (March 19) in Tampa, FL. There are still seats available, so you have time to register. As a special favor to me, if you plan to attend, the quicker you sign up, the faster I know how many are attending and I can order the correct amount of food. Here’s a little background (in case you ...

PowerTip: Add Hyper-V network switch to network packet capture session
Feb 21, 2016
Post comments count 0
Post likes count 0

PowerTip: Add Hyper-V network switch to network packet capture session

Doctor Scripto
Doctor Scripto

Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session.  How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session?  Use the Add-NetEventVmSwitch cmdlet and specify the name of the switch. In the following commands, I create a new event session, specify a packet capture provider, and then add the Hyper-V switch: PS C:\>New-NetEventSession -Name "NESession01" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "NESession01" PS C:\> Add-NetEventVMSwitch -Name "Network Adapter 2 - Virtual Switch"  

PowerTip: Add virtual network adapter to packet capture session
Feb 21, 2016
Post comments count 0
Post likes count 0

PowerTip: Add virtual network adapter to packet capture session

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to add a virtual network adapter to a network packet capture session.  How can I use Windows PowerShell to add a virtual network adapter to a network packet capture session?  Use the Add-NetEventVmNetworkAdapter cmdlet and specify the name of the adapter. In the following example, I create a net event session, add a capture provider, and then specify the virtual network adapter: PS C:\>New-NetEventSession -Name "NESession01" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "NESession01" PS C:\> Add-NetEventVMNetworkAdapter -Name "LargeGuid"

PowerTip: Use PowerShell to add ETW provider to a session
Feb 20, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to add ETW provider to a session

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to add an ETW provider to a session.  How can I use Windows PowerShell to add an ETW provider to a session?  Use the Add-NetEventProvider cmdlet and specify the name of the session and the provider. In the following example, first a net event session is created, and then the TCPIP ETW provider is added to the session: PS C:\>New-NetEventSession -SessionName "Session01" PS C:\> Add-NetEventProvider -Name "Microsoft-Windows-TCPIP" -SessionName  "Session01"

PowerTip: Add network adapter to packet capture session
Feb 20, 2016
Post comments count 0
Post likes count 0

PowerTip: Add network adapter to packet capture session

Doctor Scripto
Doctor Scripto

Summary: Learn to use Windows PowerShell to add a network adapter to a capture session.  How can I use Windows PowerShell to add a network adapter to a packet capture session? Use the Add-NetEventNetworkAdapter cmdlet and specify the name of the adapter. In the following example, I create a network capture session, add a provider, and then add the network adapter: PS C:\>New-NetEventSession -Name "Session38" PS C:\> Add-NetEventPacketCaptureProvider -SessionName "Session38" PS C:\> Add-NetEventNetworkAdapter -Name "Ethernet01"

PowerTip: Set ErrorActionPreference to original value
Feb 19, 2016
Post comments count 0
Post likes count 0

PowerTip: Set ErrorActionPreference to original value

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to work with the ErrorActionPreference variable in Windows PowerShell.  I have a script that requires me to change the ErrorActionPreference variable, but how can I set it to its original value after the script is done?  Store the current value of $ErrorActionPreference and set it again later: $OldEAP = $ErrorActionPreference $ErrorActionPreference = 'silentlycontinue' #Your script runs in here $ErrorActionPreference = $OldEAP

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 5
Feb 19, 2016
Post comments count 0
Post likes count 0

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 5

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows how to modify the registry for SHA-256 as a part of migrating a Windows certification authority from CSP to KSP and from SHA-1 to SHA-256. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner) or on my blog, Working Sysadmin: Figuring stuff out at work. I recently had the chance to work with Microsoft PFE, Mike MacGillivray, on an upgrade of some Windows certification authorities, and I want to share some information ...

PowerTip: Count backwards in array
Feb 18, 2016
Post comments count 0
Post likes count 0

PowerTip: Count backwards in array

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to count backwards in a Windows PowerShell array.  I know I can access the first, second, and third items in an array by using $Array[0], $Array[1], and $Array[2], but how can I count backwards?  Use negative numbers, for example: $Array = @('first','second','third') $Array[0] $Array[1] $Array[2] $Array[-1] $Array[-2] $Array[-3] This will output the following: first second third third second first

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 4
Feb 18, 2016
Post comments count 0
Post likes count 0

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 4

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows how to import a certificate into a KSP and bring it into the certificate store. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner) or on my blog, Working Sysadmin: Figuring stuff out at work. I recently had the chance to work with Microsoft PFE, Mike MacGillivray, on an upgrade of some Windows certification authorities, and I want to share some information about it with you. This script has only been tested on Wind...

PowerTip: Prompt user for value but provide default
Feb 17, 2016
Post comments count 0
Post likes count 0

PowerTip: Prompt user for value but provide default

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to set a variable to a default value in PowerShell.  How can I use Windows PowerShell to prompt a user for a value for a variable, but provide a default value if the user doesn’t enter anything?  First prompt the user for the value to the variable and then detect if the response was empty. If the response is empty, set the value of the variable. You can validate parameters for a function more conveniently than this. This code is for inline variables in an interactive script: $Interesting = Read-Host -Prompt 'Give me a value [some-value]' if...

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 3
Feb 17, 2016
Post comments count 0
Post likes count 0

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 3

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows how to delete your Windows CA certificates and crypto provider as a part of migrating a Windows certification authority from CSP to KSP and from SHA-1 to SHA-256. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner) or on my blog, Working Sysadmin: Figuring stuff out at work. I recently had the chance to work with Microsoft PFE, Mike MacGillivray, on an upgrade of some Windows certification authorities, and I want to...

PowerTip: Use positional parameters
Feb 16, 2016
Post comments count 0
Post likes count 0

PowerTip: Use positional parameters

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to use positional parameters in Windows PowerShell.  I always see people pass variables or data to a function without specifying the parameter name that the data is for, for example: “copy-item $source $destination” acts like “copy-item –path $source –destination $destination” How do I do that in my functions, and how does the function know which variable is the path and destination?  In functions, you declare parameters before doing much else. When declaring your parameter, indicate the Position starting with 0, for example: Function Invok...

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 2
Feb 16, 2016
Post comments count 0
Post likes count 0

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 2

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows how to back up your Windows certification authority as a part of migrating from CSP to KSP and from SHA-1 to SHA-256. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner) or on my blog, Working Sysadmin: Figuring stuff out at work. I recently had the chance to work with Microsoft PFE, Mike MacGillivray, on an upgrade of some Windows certification authorities, and I want to share some information about it with you. Th...

PowerTip: Send output to file and screen at the same time
Feb 15, 2016
Post comments count 0
Post likes count 0

PowerTip: Send output to file and screen at the same time

Doctor Scripto
Doctor Scripto

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how to easily send data to the output of a script.  How can I use Windows PowerShell to send the same data that I’m writing to a file to the standard output of my script?  In Windows PowerShell 5.0, use Tee-Object, for example: PS C:\WINDOWS\system32> Tee-Object -InputObject 'Some text' -FilePath 'C:\temp\some file.txt' Some text PS C:\WINDOWS\system32> Get-Content -Path 'C:\temp\some file.txt' Some text

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 1
Feb 15, 2016
Post comments count 1
Post likes count 0

Migrate Windows CA from CSP to KSP and from SHA-1 to SHA-256: Part 1

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows how to start the migration of a Windows certification authority from CSP to KSP and from SHA-1 to SHA-256. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy this week. You can find me on Twitter (@MrThomasRayner) or on my blog, Working Sysadmin: Figuring stuff out at work. I recently had the chance to work with Microsoft PFE, Mike MacGillivray, on an upgrade of some Windows certification authorities, and I want to share some information about it with you. This script h...

PowerTip: Use PowerShell to add exclusion folder to Windows Defender
Feb 14, 2016
Post comments count 1
Post likes count 0

PowerTip: Use PowerShell to add exclusion folder to Windows Defender

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to add an exclusion folder to Windows Defender.  How can I add the C:\temp folder to the exclusion list so it is not scanned by Windows Defender?  Use the Add-MpPreference cmdlet and specify the exclusion path, for example: Add-MpPreference -ExclusionPath "C:\Temp" Note  You must run Windows PowerShell with elevated permissions when you execute this command or an error arises.

PowerTip: Flush file system cache by using PowerShell
Feb 14, 2016
Post comments count 0
Post likes count 0

PowerTip: Flush file system cache by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to forcibly write the file system cache to a drive.  How can I use Windows PowerShell to forcibly flush the volume cache by writing it to a drive?  Use the Write-VolumeCache cmdlet and specify the drive letter, for example: Write-VolumeCache c Note  There is no colon following the drive letter.

PowerTip: Use PowerShell to remove app package from image
Feb 13, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to remove app package from image

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to remove an app package from a Windows image.  How can I use Windows PowerShell to remove an app package from a Windows image?  Use the Remove-AppxProvisionedPackage cmdlet, for example: Remove-AppxProvisionedPackage –Path c:\offline –PackageName MyAppxPkg

PowerTip: Fully format drive using PowerShell
Feb 13, 2016
Post comments count 0
Post likes count 0

PowerTip: Fully format drive using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to do a full format of a drive.  How can I use Windows PowerShell to do a full format of a drive?  Use the Format-Volume cmdlet and specify the -FullFormat parameter, for example: Format-Volume -DriveLetter C -FileSystem FAT32 -FullFormat –Force

PowerTip: Use PowerShell to format drive
Feb 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to format drive

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to quickly format a drive.  How can I use Windows PowerShell to quickly format a drive?  Use the Format-Volume cmdlet and specify the drive letter, for example: Format-Volume -DriveLetter D

Finding WMI classes that contain methods
Feb 12, 2016
Post comments count 0
Post likes count 0

Finding WMI classes that contain methods

Doctor Scripto
Doctor Scripto

Summary: Learn how to find methods from WMI classes. Sometimes when working with WMI, it might seem as if you are entering a strange territory with dangers lurking around every corner. Unfortunately, there might not even be a sign such as the following to alert you to the hidden dangers: But by using the CIM cmdlets, we can bring a bit of order to an otherwise messy situation. If I do not know the name of a WMI method, I can use a wildcard character to find the method. If I use the *, my command will return all WMI classes that have a method defined: Get-CimClass -MethodName * The command and output from the...

PowerTip: List all WMI classes
Feb 11, 2016
Post comments count 1
Post likes count 0

PowerTip: List all WMI classes

Doctor Scripto
Doctor Scripto

Summary: Use the Get-CimClass cmdlet to easily list all classes in current WMI namespace.  How can I use Windows PowerShell to list all of the WMI classes in the current WMI namespace?  Use the Get-CimClass cmdlet.

Use CIM cmdlets to find WMI classes
Feb 11, 2016
Post comments count 0
Post likes count 0

Use CIM cmdlets to find WMI classes

Doctor Scripto
Doctor Scripto

Summary: Learn how to locate the right WMI class by using the Get-CimClass cmdlet to work through the class schema. Windows Management Instrumentation (WMI) came into the Windows world around the time of the Windows NT 4.0 Service Pack 4—that’s about the same time as the release of Star Wars 1: The Phantom Menace. One of the really cool things about WMI was that I could (with some difficulty) write VBScript scripts that accessed the WMI schema. Therefore, I could use script to search through the WMI classes to help me locate and find information that I would later use in other VBScript scripts. In this way, it wa...

PowerTip: Find default PowerShell modules
Feb 10, 2016
Post comments count 0
Post likes count 0

PowerTip: Find default PowerShell modules

Doctor Scripto
Doctor Scripto

Summary: Find Windows PowerShell modules that load by default.  How can I easily find what modules are loading in my Windows PowerShell console by default?  Open your Windows PowerShell console, and before doing anything, type Get-Module.

Using the PowerShell CIM cmdlets for fun and profit
Feb 10, 2016
Post comments count 0
Post likes count 0

Using the PowerShell CIM cmdlets for fun and profit

Doctor Scripto
Doctor Scripto

Summary: Learn how to use CIM cmdlets for better speed, security, and data return as opposed to the WMI cmdlets in Windows PowerShell. The other day, Windows PowerShell MVP, Richard Siddaway, posted Should I use CIM or WMI with Windows PowerShell? Today, I would like to continue that discussion a little bit. You should read Richard’s blog post before you read mine today. In the old days (like way back in Windows PowerShell 1.0), if you wanted to do anything on a remote computer, you were pretty much limited to using WMI—kind of like things were in the VBScript days. Sure, there were some things that you could d...

PowerTip: Use PowerShell to get only the date
Feb 9, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to get only the date

Doctor Scripto
Doctor Scripto

Summary: Learn how to find only the date by using the Get-Date cmdlet.  How can I use Windows PowerShell to easily display only the date (not the time)?  Use the Get-Date cmdlet and specify a display hint of date, for example: Get-Date -DisplayHint date

PowerTip: Use Get-Command to resolve PowerShell alias
Feb 9, 2016
Post comments count 0
Post likes count 1

PowerTip: Use Get-Command to resolve PowerShell alias

Doctor Scripto
Doctor Scripto

Summary: Learn how to use the Get-Command cmdlet to resolve an alias to a Windows PowerShell command.  How can I find if a Windows PowerShell command is an alias?  Use the Get-Command cmdlet, for example: gcm gwmi Note: gcm is an alias for Get-Command.

PowerTip: Find schema of a WMI class
Feb 8, 2016
Post comments count 0
Post likes count 0

PowerTip: Find schema of a WMI class

Doctor Scripto
Doctor Scripto

Summary: Learn how use Windows PowerShell to find the schema of a WMI class.  How can I use Windows PowerShell to look at the schema of a WMI class?  Use the Get-CIMClass cmdlet, for example: Get-CimClass win32_bios

Should I use CIM or WMI with Windows PowerShell?
Feb 8, 2016
Post comments count 0
Post likes count 0

Should I use CIM or WMI with Windows PowerShell?

Doctor Scripto
Doctor Scripto

Summary: Richard Siddaway explains the differences between the CIM cmdlets and the WMI cmdlets, and details use cases.  Hey, Scripting Guy! Should I use the WMI cmdlets or the newer CIM cmdlets? —NR  Hello NR, Honorary Scripting Guy, Richard Siddaway, here today filling in for my good friend, The Scripting Guy. The simple answer is that you can use either Windows Management Instrumentation (WMI) or Common Information Model (CIM) cmdlets, but there are (to my mind) some significant advantages to using the newer CIM cmdlets. Before I show you why I think you should use the CIM cmdlets, let’s do a little recap....

PowerTip: Hide a PowerShell ISE add-on
Feb 7, 2016
Post comments count 0
Post likes count 0

PowerTip: Hide a PowerShell ISE add-on

Doctor Scripto
Doctor Scripto

Summary: Learn how to programmatically hide a Windows PowerShell ISE add-on.  How can I use code to hide one of the Windows PowerShell ISE add-ons?  Use the Windows PowerShell ISE object model, and set the IsVisible property of the add-on to False, for example: $psISE.PowerShellTabs.VerticalAddOnTools.Item(0).isvisible = $false  

PowerTip: Display Windows PowerShell ISE add-ons
Feb 7, 2016
Post comments count 0
Post likes count 0

PowerTip: Display Windows PowerShell ISE add-ons

Doctor Scripto
Doctor Scripto

Summary: Display the Windows PowerShell ISE add-ons that are available.  How can I programmatically display the Windows PowerShell ISE add-ons that are available and show their status?  Use the Windows PowerShell ISE object model to display the VerticalAddonTools collection from the PowerShellTabs collection: $psISE.PowerShellTabs.VerticalAddOnTools

PowerTip: List all scripts open in Windows PowerShell ISE
Feb 6, 2016
Post comments count 0
Post likes count 0

PowerTip: List all scripts open in Windows PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: List all the scripts that are open in the Windows PowerShell ISE.  How can I find which scripts are open in the Windows PowerShell ISE and if they are saved?  Use the ISE object model and display the Files collection from the PowerShellTabs collection: $psISE.PowerShellTabs.Files

PowerTip: Open a script in PowerShell ISE
Feb 6, 2016
Post comments count 0
Post likes count 0

PowerTip: Open a script in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Automatically open a script in the Windows PowerShell ISE.  How can I automatically open a script in the Windows PowerShell ISE from within a script?  Use the Windows PowerShell ISE automation model, and use the Add method for the Files collection on the current PowerShell tab, for example: $psISE.CurrentPowerShellTab.Files.Add("C:\fso\backup.ps1")  

PowerTip: Update a PowerShell module
Feb 5, 2016
Post comments count 0
Post likes count 0

PowerTip: Update a PowerShell module

Doctor Scripto
Doctor Scripto

Summary: Learn how to update an installed Windows PowerShell module.  I used Install-Module to install a Windows PowerShell module, but how can I update it?  Use the Update-Module cmdlet, for example: Here are a couple of other examples: find-module *ise-preview | Update-Module Update-Module *ise-preview

Playing with PowerShell ISE Preview
Feb 5, 2016
Post comments count 0
Post likes count 0

Playing with PowerShell ISE Preview

Doctor Scripto
Doctor Scripto

Summary: This blog post explores the features and functionality of the newly released Windows PowerShell ISE Preview edition that runs on Windows PowerShell 5.0. After you install the Windows PowerShell ISE preview from the PowerShell Gallery and take a look at the modules and functions it provides, it is time to fire up the new ISE and play a bit. I click the new shortcut in my All Apps section on my laptop running Windows 10. (To make it a bit more accessible, I drag the shortcut to my tool bar. I mean, I rarely go searching through the All Apps section.) I add a blank page to the ISE, and it looks pretty muc...

PowerTip: Install module from PowerShell Gallery
Feb 4, 2016
Post comments count 0
Post likes count 0

PowerTip: Install module from PowerShell Gallery

Doctor Scripto
Doctor Scripto

Summary: Learn how to install a module from the PowerShell Gallery.  How can I easily install a module from the PowerShell Gallery?  Use the Install-Module cmdlet in Windows PowerShell 5.0, and specify the name of the module.

A first look at Windows PowerShell ISE Preview
Feb 4, 2016
Post comments count 0
Post likes count 0

A first look at Windows PowerShell ISE Preview

Doctor Scripto
Doctor Scripto

Summary: Take a first look at the newly released Windows PowerShell ISE Preview. Good morning everyone. Ed Wilson here. I can tell you that the list of speakers for PowerShell Saturday on in Tampa March 19, 2016 looks really impressive. There are going to be seven MVPs and six Microsoftees there! When it comes to Microsoft Automation, this is going to be the place to be in March. Registration is still open, but it is starting to fill up quickly. Yesterday in Install the PowerShell ISE Preview from the PowerShell Gallery, I looked at downloading and installing Windows PowerShell ISE Preview. Because this installs...

PowerTip: Find published modules in the PowerShell Gallery
Feb 3, 2016
Post comments count 0
Post likes count 0

PowerTip: Find published modules in the PowerShell Gallery

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Published Windows PowerShell modules in the PowerShell Gallery.  How can I use Windows PowerShell to find modules that are published in the Windows PowerShell Gallery?  Use the Find-Module cmdlet in Windows PowerShell 5.0. This example finds modules related to the ISE: Find-Module *ISE*

Install the PowerShell ISE Preview from the PowerShell Gallery
Feb 3, 2016
Post comments count 0
Post likes count 0

Install the PowerShell ISE Preview from the PowerShell Gallery

Doctor Scripto
Doctor Scripto

Summary: Learn how to install the Windows PowerShell ISE Preview edition from the PowerShell Gallery to Windows PowerShell 5.0 by using a one-line command. One of the way cool things is that the Windows PowerShell ISE is released to the PowerShell Gallery. “PowerShell Gallery?” you might ask. Yeah, the PowerShell Gallery. Although this version of the PowerShell ISE is currently still under limited preview, this does not mean that you can’t use it. In fact, you should be using it. I go to the PowerShell Gallery page, and type ISE in the Search box, and what comes back is a bunch of stuff related ...

PowerTip: Learn about PowerShell default parameter values
Feb 2, 2016
Post comments count 0
Post likes count 0

PowerTip: Learn about PowerShell default parameter values

Doctor Scripto
Doctor Scripto

Summary: Learn about the default parameter values in Windows PowerShell.  How can I find more about default parameter values in Windows PowerShell?  Use the Get-Help cmdlet and search for *defaultParameter*. The following command returns a            list of Help topics that provide this information: help *DefaultParameter*

Convert a web page into objects for easy scraping with PowerShell
Feb 2, 2016
Post comments count 1
Post likes count 1

Convert a web page into objects for easy scraping with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell 5.0 to scrape a web page so that you can easily return parsable objects. Good morning. Ed Wilson here, and today I have a guest blog post by Doug Finke... When surfing the PowerShell Gallery, you'll find that each module has a web page with a version history, for example: Wouldn't it be great if you could get this information at the command line? Click here for a 20 second video that shows the code to do it. How to do web scrapping This approach will only work in Windows PowerShell 5.0, because it uses the new ConvertFrom-String function to convert the...

PowerTip: Get password from PowerShell credential object
Feb 1, 2016
Post comments count 0
Post likes count 0

PowerTip: Get password from PowerShell credential object

Doctor Scripto
Doctor Scripto

Summary: Learn how to retrieve the password from a Windows PowerShell credential object.  I am having a problem connecting to an application via Windows PowerShell. How can I verify the user name and password that was supplied to the credential object?  Assuming you have permissions to the object, you can use the GetNetworkCredential method, for example: $a = Get-Credential $a.GetNetworkCredential() | fl *

PowerShell spotlight: February 2016
Feb 1, 2016
Post comments count 0
Post likes count 0

PowerShell spotlight: February 2016

Doctor Scripto
Doctor Scripto

Summary: Windows PowerShell MVP, Teresa Wilson, shares her roundup of Windows PowerShell activities for the coming months. Hello scripters, Teresa Wilson here. I hope you had a marvelous weekend and are ready to tackle this week. Ed is finally getting back to normal and we have a few trips coming up—all Windows PowerShell related. Arizona PowerShell User Group March 1 in Phoenix First of all, we will be in Phoenix, AZ on March 1, 2016 for the Arizona PowerShell User Group (AZPOSH) meeting. I also heard from a little birdie that my good friend Jason Helmick will be there. The signup is not available yet (they are ...

PowerTip: Use PowerShell to view properties and their values for a .NET Framework class
Jan 31, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to view properties and their values for a .NET Framework class

Doctor Scripto
Doctor Scripto

Summary: Learn how to view properties and the associated values of those properties of .NET Framework classes with Windows PowerShell.  How can I use Windows PowerShell to view the properties and their values from a .NET Framework class,            such as System.String?  Use the Type accelerator [string], pipe the output to the Format-List cmdlet, and use an asterisk to            select all properties: [string] | fl * Note: fl is an alias for Format-List.

PowerTip: Find properties of .NET Framework class with PowerShell
Jan 31, 2016
Post comments count 0
Post likes count 0

PowerTip: Find properties of .NET Framework class with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to display properties of a .NET Framework class.  How can I use Windows PowerShell to easily display properties of a .NET Framework class?  Pipe the type accelerator to the Get-Member cmdlet and specify the MemberType property,            for example: [string] | gm -MemberType Properties Note: gm is an alias for Get-Member.

PowerTip: Find information about .NET Framework method with PowerShell
Jan 30, 2016
Post comments count 0
Post likes count 0

PowerTip: Find information about .NET Framework method with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find information about a .NET framework method.  How can I use Windows PowerShell to find basic information about a particular .NET Framework method?  Use the GetMethod method from the class, for example:  [math].GetMethod("Tan") Note  The method name is case sensitive and it must be in double quotation marks.

PowerTip: Use PowerShell to find all methods from .NET Framework class
Jan 30, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to find all methods from .NET Framework class

Doctor Scripto
Doctor Scripto

Summary: Learn how to find all methods from a .NET Framework class by using Windows PowerShell.  How can I use Windows PowerShell to show both static and dynamic methods for a .NET Framework class?  Use the GetMethods method from the class. This example uses the System.Math class to return the            method name and if the method is static: [math].GetMethods() | Select Name, IsStatic -Unique

PowerTip: Return remainder after dividing two numbers
Jan 29, 2016
Post comments count 0
Post likes count 0

PowerTip: Return remainder after dividing two numbers

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to return the remainder after dividing two numbers.  How can use Windows PowerShell to divide two numbers and only return the remainder (called a modulo operation)?  In Windows PowerShell, the modulo operator is the % sign. Here are a few examples of how to use it: PS C:\> 3 % 2 1 PS C:\> 5 % 2 1 PS C:\> 11 % 2 1

How to contribute to PowerShell documentation
Jan 29, 2016
Post comments count 0
Post likes count 0

How to contribute to PowerShell documentation

Doctor Scripto
Doctor Scripto

Summary: Learn how to contribute to Windows PowerShell documentation via various community initiatives. Today’s guest blog post is by Microsoft premier field engineer, Ashley McGlone. He will be speaking at PowerShell Saturday, so come join us for a great day of PowerShell learning. For more information, see PowerShell Saturday in Tampa, FL, March 19, 2016. Follow Ashley through his TechNet blog, Goatee PFE, and Twitter. Here’s Ashley… How many times have you found PowerShell documentation that was not up-to-date? Or maybe you could not even find the documentation you needed. Today I’ll be discussing ways that ...

PowerTip: Add number to existing variable value
Jan 28, 2016
Post comments count 0
Post likes count 0

PowerTip: Add number to existing variable value

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily add a number to an existing value stored in a variable and update the value of the variable.  How can I use Windows PowerShell to add a number to a value stored in a variable so that I can update the            value in that variable with the number and store the number back into the variable?  Use the += operator. This example adds 3 to the value stored in the $a variable and then stores the new            value back into the variable: PS C:\> $a = 5 PS C:\> $a += 3 PS C:\> $a 8

Use PowerShell to parse event log for shutdown events
Jan 28, 2016
Post comments count 0
Post likes count 0

Use PowerShell to parse event log for shutdown events

Doctor Scripto
Doctor Scripto

Summary: Using the Windows PowerShell Get-EventLog cmdlet makes it easy to parse the system event log for shutdown events. One of the great things about central Florida during this time of the year is that there are certain fruits, such as red grapefruit, that are in season. This is also true of a certain variety of tangelo that is super sweet. However, as sweet as both of these are, neither is a sweet as parsing the event log with Windows PowerShell. It makes it easy to gain insights into what is going on with your computer, server, or whatever device. Using Get-EventLog cmdlet is super easy There are two basic ...

PowerTip: Use PowerShell to create repeating letters
Jan 27, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to create repeating letters

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily create duplicate letters by using Windows PowerShell.  How can I use Windows PowerShell to easily create a specific number of letters in a repetitive fashion?  To create repetitive letters, all you need to do is to “multiply” them, for example: PS C:\> "a"*5 aaaaa

Using Desired State Configuration and Chef to deploy System Center
Jan 27, 2016
Post comments count 0
Post likes count 0

Using Desired State Configuration and Chef to deploy System Center

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Chef and DSC in Windows PowerShell to deploy System Center in this guest blog post by Jason Morgan.Ed Wilson, here. Today I have a guest blog post by Jason Morgan in which he will talk about using Desired State Configuration (DSC) and Chef to deploy System Center. Welcome back, Jason…Hello again. Today I’m writing to analyze the deployment of System Center by using Desired State Configuration and Chef. I’ve been using Chef heavily for the last six months because I decided that using DSC to run my System Center deployments was a too heavy lift on its own. Adding Chef ha...

PowerTip: Import colon-delimited file with PowerShell
Jan 26, 2016
Post comments count 0
Post likes count 0

PowerTip: Import colon-delimited file with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to import a file that uses a colon as a delimiter.  How can I use Windows PowerShell to import a file that is delimited with a colon instead of a comma?  Use the Import-CSV cmdlet and specify the colon as the delimiter, for example: import-csv -Path C:\fso\applog.csv -Delimiter ':'

Announcing the 2015 Honorary Scripting Guys
Jan 26, 2016
Post comments count 0
Post likes count 0

Announcing the 2015 Honorary Scripting Guys

Doctor Scripto
Doctor Scripto

Summary: The Honorary Scripting Guys for 2015 are announced in this blog post. Microsoft Scripting Guy, Ed Wilson, is here. I have been pretty busy—I missed work because of my ear surgery and the holidays, so I have enlisted the help of the Scripting Wife, Teresa Wilson, to write this post to announce the 2015 Honorary Scripting Guys. I gave her the names and she did the rest. Wow, that is almost exactly what I wrote last year, and it holds true for this year. The main difference is that the recovery time from my ear surgery was quite a bit longer than I anticipated. Hopefully that is the last ear surgery for m...

PowerTip: Find running services with PowerShell
Jan 25, 2016
Post comments count 0
Post likes count 1

PowerTip: Find running services with PowerShell

mredwilson
mredwilson

Summary: Use Windows PowerShell to find running services.  How can I use Windows PowerShell to quickly produce a sortable list of running services on my computer?  Use the Get-Service cmdlet to return the services, and the Out-GridView to produce a sortable list: gsv | ogv Note   gsv is an alias for Get-Service, and ogv is an alias for Out-GridView.

Introducing the top five Hey, Scripting Guy! Blog posts in 2015
Jan 24, 2016
Post comments count 0
Post likes count 0

Introducing the top five Hey, Scripting Guy! Blog posts in 2015

mredwilson
mredwilson

Summary: See which Hey, Scripting Guy! Blog posts were the top five in 2015.Today I feature Honorary Scripting Guy and Windows PowerShell MVP, Teresa Wilson, aka The Scripting Wife. Take it away Teresa…Hello everyone, with over 700 new posts a year on the Hey, Scripting Guy! Blog, the number one thing I hear at conferences and user group meetings is that it is practically impossible to keep up with the blog. I happen to have an RSS feed that comes to Outlook, so I am able to keep up fairly well. The exception is when I go on vacation, or am otherwise not as connected to the Internet as I might wish.Anyway,...

PowerTip: Find disk status with PowerShell and Windows 10
Jan 24, 2016
Post comments count 0
Post likes count 0

PowerTip: Find disk status with PowerShell and Windows 10

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell in Windows 10 to find disk status.  How can I use Window PowerShell in Windows 10 to check the status information (such as the health status,            operational status, and if the disks are offline or read-only) on multiple disks?  Use the Get-DiskStorageNodeView cmdlet: Get-DiskSNV Note  Get-DiskSNV is an alias for Get-DiskStorageNodeView.

PowerTip: Create list of approved PowerShell verbs
Jan 23, 2016
Post comments count 0
Post likes count 0

PowerTip: Create list of approved PowerShell verbs

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily produce a list of approved Windows PowerShell verbs.  How can I find what verbs are approved for use in a Windows PowerShell function?  Use the Get-Verb cmdlet, and to make it easy to peruse, send the output to the Out-GridView cmdlet: get-verb | Out-GridView

PowerTip: Find single-name PowerShell functions
Jan 22, 2016
Post comments count 0
Post likes count 0

PowerTip: Find single-name PowerShell functions

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Windows PowerShell functions that do not have a hyphen in the name.  How can I easily find Windows PowerShell functions that do not have a hyphen in the name, but instead are single words, such as the Prompt function?  Use the Get-Command cmdlet and return only functions. Filter out function names that do not contain a hyphen, for example: gcm -CommandType function | where name -notmatch '-' Note gcm is an alias for the Get-Command cmdlet.

PowerTip: Find top PowerShell cmdlet nouns
Jan 21, 2016
Post comments count 0
Post likes count 0

PowerTip: Find top PowerShell cmdlet nouns

Doctor Scripto
Doctor Scripto

Summary: Learn how to find the top five nouns in Windows PowerShell cmdlets.  How can I find which nouns are the most prevalent in Windows PowerShell cmdlets?  You need to find all of the cmdlet names, group them by noun, sort them by count, and then select only           the first five, for example: gcm * -CommandType cmdlet | group noun -noelement | sort count -Descending | select -First 5 Note gcm is an alias for Get-Command.

PowerTip: Use PowerShell to return first two lines of file
Jan 20, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to return first two lines of file

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to return the first two lines of a text file. How can I use Windows PowerShell to easily return the first two lines of a text file? Use the Get-Content cmdlet and specify the TotalCount parameter. In this example, TotalCount is set           to 2 and the file is named AMoreComplete.txt:Get-Content 'C:\fso\AMoreComplete.txt' -TotalCount 2

PowerTip: Use PowerShell to return first two lines of file
Jan 20, 2016
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to return first two lines of file

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to return the first two lines of a text file. How can I use Windows PowerShell to easily return the first two lines of a text file? Use the Get-Content cmdlet and specify the TotalCount parameter. In this example, TotalCount is set           to 2 and the file is named AMoreComplete.txt:Get-Content 'C:\fso\AMoreComplete.txt' -TotalCount 2

PowerTip: Find related cmdlet aliases
Jan 19, 2016
Post comments count 0
Post likes count 0

PowerTip: Find related cmdlet aliases

Doctor Scripto
Doctor Scripto

Summary: Learn how to find aliases related to a series of cmdlets.  How can I find aliases that are related to a series of Windows PowerShell cmdlets, such as processes?  Use the Get-Alias cmdlet and specify a wildcard character for the definition parameter, for example: Get-Alias -Definition "*process"

PowerTip: Find related cmdlet aliases
Jan 19, 2016
Post comments count 0
Post likes count 0

PowerTip: Find related cmdlet aliases

Doctor Scripto
Doctor Scripto

Summary: Learn how to find aliases related to a series of cmdlets. How can I find aliases that are related to a series of Windows PowerShell cmdlets, such as processes? Use the Get-Alias cmdlet and specify a wildcard character for the definition parameter, for example:Get-Alias -Definition "*process"

PowerTip: Find cmdlets and functions related to DSC
Jan 18, 2016
Post comments count 0
Post likes count 0

PowerTip: Find cmdlets and functions related to DSC

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find cmdlets and functions related to Desired State Configuration.  How can I use Windows PowerShell to quickly find a list of cmdlets and functions related to            Desired State Configuration (DSC)?  Use the Get-Command cmdlet and specify a noun of *dsc*: Get-Command -Noun *DSC*

PowerTip: Find cmdlets and functions related to DSC
Jan 18, 2016
Post comments count 0
Post likes count 0

PowerTip: Find cmdlets and functions related to DSC

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find cmdlets and functions related to Desired State Configuration.  How can I use Windows PowerShell to quickly find a list of cmdlets and functions related to            Desired State Configuration (DSC)?  Use the Get-Command cmdlet and specify a noun of *dsc*: Get-Command -Noun *DSC*

PowerTip: Find Amount of Time Between Two Dates
Jan 17, 2016
Post comments count 0
Post likes count 0

PowerTip: Find Amount of Time Between Two Dates

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find the amount of time between two dates.  How can I use Windows PowerShell to determin how many days until            Windows PowerShell Saturday on March 19, 2016 in Tampa?  There are many ways to find the difference between two dates. I use the [datetime] type accelerator            and subtraction, for example: [datetime]'3/19/16' - [datetime]::now  

Weekend Scripter: Find Information on the Hey, Scripting Guy! Blog
Jan 17, 2016
Post comments count 0
Post likes count 0

Weekend Scripter: Find Information on the Hey, Scripting Guy! Blog

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about how to find stuff on the Hey, Scripting Guy! Blog. Microsoft Scripting Guy, Ed Wilson, is here. It is hard to imagine that it is 2016. It’s even harder to imagine that I have been writing the Hey, Scripting Guy! Blog since 2008! With the current pace of twice a day posts, 7 days a week, there are literally thousands of Hey, Scripting Guy! Blog posts—plus there was a team writing Scripting Guy content before there was a Hey, Scripting Guy! Blog. One of my first major projects after becoming the Microsoft Scripting Guy was to work with my editor a...

PowerTip: Find Processes by Using Wildcard Characters
Jan 16, 2016
Post comments count 0
Post likes count 0

PowerTip: Find Processes by Using Wildcard Characters

Doctor Scripto
Doctor Scripto

Summary: Learn how to use wildcard characters and Windows PowerShell to find processes.  How can I use Windows PowerShell to easily see all processes that contain the letters SV in the process name?  Use the Get-Process cmdlet and a simple wildcard pattern, for example: gps *sv* Note   gps is an alias for Get-Process.

Weekend Scripter: PowerShell Saturday in Tampa,FL, March 19, 2016
Jan 16, 2016
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell Saturday in Tampa,FL, March 19, 2016

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell Saturday in Tampa Florida on March 19, 2016. Microsoft Scripting Guy, Ed Wilson, is here. There are worse places to be in March than in Tampa, Florida. If you come to Florida, you might see the elusive and endangered Florida panther. You could see a bear. If you get out on the water, you will more than likely see a dolphin. You will probably see a gator, especially if you hang around swamps and creeks. What I can say for sure, is that if you are in Tampa on March 19, 2016, you will definitely see some awesome Windows PowerShell. The othe...

PowerTip: Use PowerShell to Find Command Line of Processes
Jan 15, 2016
Post comments count 0
Post likes count 1

PowerTip: Use PowerShell to Find Command Line of Processes

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find the command line of processes.  How can I find the command line that was used to launch a process that is running on my system?  Use the Get-CimInstance cmdlet, the Win32_Process WMI class, and the CommandLine property: gcim win32_process | select commandline Note  gcim is an alias for Get-CimInstance.

Working with Windows Startup Processes and PowerShell
Jan 15, 2016
Post comments count 0
Post likes count 0

Working with Windows Startup Processes and PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to examine startup processes in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. This morning I am playing with the Xbox One Smart Glass app on Windows 10. I have used the app since it was in beta, and I just got my Xbox One. But I have started using the Pandora app on my Xbox One, and I like to do stuff like mute advertisements, skip boring songs, change stations, and otherwise control the app. Yeah, I can use my Xbox controller, and with a recent firmware update, it does connect faster, and has better battery life, bu...

PowerTip: Find PowerShell Cmdlets that Work with CSVs
Jan 14, 2016
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Cmdlets that Work with CSVs

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Windows PowerShell cmdlets that work with CSVs.  How can I find Windows PowerShell cmdlets that I can use to work with a CSV file?  Use the Get-Command cmdlet and look for cmdlets that have a noun of CSV: Get-Command -Noun csv*

Use PowerShell to Work with Data from MS OMS
Jan 14, 2016
Post comments count 0
Post likes count 0

Use PowerShell to Work with Data from MS OMS

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to parse data obtained from Microsoft Operations Management Suite. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I have been working on a lot the past month is the new Microsoft Operations Management Suite Blog. For one thing, it is on the new blogging platform we using at Microsoft, so the blog is like a new toy with lots of fun things for a geek to play with. In addition, Microsoft Operations Management Suite (MS OMS) is a tremendously powerful platform that uses Windows PowerShell in the background, so it is also...

PowerTip: Find Help about PowerShell Pipelines
Jan 13, 2016
Post comments count 0
Post likes count 0

PowerTip: Find Help about PowerShell Pipelines

mredwilson
mredwilson

Summary: Learn how to find Windows PowerShell Help about pipelines.  How can I find information so that I can read about Windows PowerShell pipelines?  Use the Get-Help cmdlet, specify the category of HelpFile, then type the word pipeline, for example: Get-Help -Category HelpFile pipeline

Incorporating Pipelined Input into PowerShell Functions
Jan 12, 2016
Post comments count 0
Post likes count 0

Incorporating Pipelined Input into PowerShell Functions

mredwilson
mredwilson

Summary: Microsoft MVP, Adam Bertram, talks about accepting pipelined input into Windows PowerShell advanced functions. Microsoft Scripting Guy, Ed Wilson, is here. Today Microsoft MVP, Adam Bertram, returns to talk about accepting pipeline input into advanced Windows PowerShell functions. Note   This is the second post in a series. Don’t miss Introduction to Advanced PowerShell Functions. When you begin to learn Windows PowerShell, you'll soon find yourself neck-deep in objects. Objects are one of the fundamental concepts of what makes PowerShell so user-friendly—and powerful at t...

PowerTip: Find List of PowerShell Functions
Jan 12, 2016
Post comments count 0
Post likes count 0

PowerTip: Find List of PowerShell Functions

mredwilson
mredwilson

Summary: Easily find a list of Windows PowerShell functions.  How can I produce a list of the Windows PowerShell functions that are currently available?  Use the Function PS Drive and the Get-ChildItem cmdlet: Get-ChildItem function:

Introduction to Advanced PowerShell Functions
Jan 11, 2016
Post comments count 0
Post likes count 0

Introduction to Advanced PowerShell Functions

mredwilson
mredwilson

Summary: Guest blogger, Microsoft MVP, Adam Bertram, talks about advanced Windows PowerShell functions.Microsoft Scripting Guy, Ed Wilson, is here. Today we have a guest post by Microsoft MVP, Adam Bertram. Take it away Adam…I'm a Pluralsight author and I develop online training courses that are mostly about Windows PowerShell. I recently had the opportunity to develop a course about building advanced PowerShell functions and modules, and a big topic in that course was about advanced functions.With that topic fresh on my mind, I thought how to build advanced functions would make a great post for the Hey, S...

PowerTip: Identify PowerShell Version
Jan 11, 2016
Post comments count 0
Post likes count 0

PowerTip: Identify PowerShell Version

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily find the version of Windows PowerShell, CLR, and WSMan.  How can I use Windows PowerShell to identify the version of Windows PowerShell that is running on my system?  Use the $PSversionTable automatic variable (you can use Tab expansion to avoid some typing).            The command and output are shown here:

PowerTip: Identify PowerShell Version
Jan 11, 2016
Post comments count 0
Post likes count 0

PowerTip: Identify PowerShell Version

mredwilson
mredwilson

Summary: Learn how to easily find the version of Windows PowerShell, CLR, and WSMan. How can I use Windows PowerShell to identify the version of Windows PowerShell that is running on my system? Use the $PSversionTable automatic variable (you can use Tab expansion to avoid some typing).            The command and output are shown here:

Where’s Waldo (and Where’s Ed)?
Jan 10, 2016
Post comments count 0
Post likes count 0

Where’s Waldo (and Where’s Ed)?

mredwilson
mredwilson

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the future of the Hey, Scripting Guy! Blog and other stuff. Microsoft Scripting Guy, Ed Wilson, is here. If you are a regular reader of the Hey, Scripting Guy! Blog, you will no doubt have noticed that I have not been very active these past several weeks. However, it is a testament to the Windows PowerShell community—especially to Microsoft MVP, Sean Kearny and the Scripting Editor, Dia Reeves—that the blog has not missed a single day of posts. Sean did an excellent job of rounding up guest bloggers, and Dia did a tremendous job of ensuring that...

PowerTip: Use PowerShell to Perform Case-Sensitive Comparison
Jan 10, 2016
Post comments count 1
Post likes count 0

PowerTip: Use PowerShell to Perform Case-Sensitive Comparison

mredwilson
mredwilson

Summary: Learn how to perform a case-sensitive comparison in Windows PowerShell.  I need to compare two strings while taking case sensitivity into account. I try using -eq, but it does not work.             How can I use Windows PowerShell to perform a case-sensitive comparison?  Use the -ceq operator instead of -eq. Here are two examples that compare the results of -eq and -ceq: PS C:\> 'scripting guys' -eq 'Scripting Guys' True PS C:\> 'scripting guys' -ceq 'Scripting Guys' False PS C:\>

Weekend Scripter: Unexpected Case Sensitivity in PowerShell
Jan 9, 2016
Post comments count 1
Post likes count 0

Weekend Scripter: Unexpected Case Sensitivity in PowerShell

mredwilson
mredwilson

Summary: PowerShell MVP, Mike F Robbins, discusses case sensitivity in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Mike Robbins. Mike F Robbins is a Microsoft MVP for 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 posts 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 ...

PowerTip: Check PowerShell Scripts Against Rules
Jan 9, 2016
Post comments count 0
Post likes count 0

PowerTip: Check PowerShell Scripts Against Rules

mredwilson
mredwilson

Summary: Learn how to easily check your Windows PowerShell scripts against various rules.  How can I quickly check my Windows PowerShell scripts with preconfigured rules?  Download the latest version of the Script Analyzer from the Microsoft PowerShell Gallery: PSScriptAnalyzer 1.2.0.            It snaps into the Windows PowerShell ISE is a good free tool.

PowerShell Spotlight: January 2016
Jan 8, 2016
Post comments count 0
Post likes count 0

PowerShell Spotlight: January 2016

mredwilson
mredwilson

Summary: PowerShell MVP and the Scripting Wife, Teresa Wilson, talks about upcoming events in the PowerShell community for January 2016.Microsoft Scripting Guy, Ed Wilson, is here. Today we have back guest blogger, Teresa Wilson. Teresa, as you probably know, is my real-life wife, and she is also known as the Scripting Wife. She once said that it was meant to be because her initials in real life are TSW, and if you shortened The Scripting Wife to initials it would be TSW. Take it away, TSW...Hello everyone, my apologies for not writing the PowerShell Spotlight for the last two months. I’ve been a little pre...

PowerTip: Automatically Enable PowerShell ISE Toolbar
Jan 8, 2016
Post comments count 0
Post likes count 0

PowerTip: Automatically Enable PowerShell ISE Toolbar

Doctor Scripto
Doctor Scripto

Summary: Ensure that the Windows PowerShell ISE toolbar is always enabled.  How can I use Windows PowerShell to turn on the ISE toolbar?  Turn on the toolbar with the following command: $psISE.Options.ShowToolBar=$True To turn it off, change the value to $False.

A Favorite PowerShell ISE Feature: Remote Text File Editing
Jan 8, 2016
Post comments count 0
Post likes count 0

A Favorite PowerShell ISE Feature: Remote Text File Editing

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney shows you how to edit files remotely in the Windows PowerShell ISE.        Honorary Scripting Guy, Sean Kearney, is here today to show you the last of the little nuggets I love to use in the Windows PowerShell ISE—that is editing files remotely.   Note   This is a five-part series that includes the following posts about features in the Windows PowerShell ISE: In Windows PowerShell 5.0, there is a unique cmdlet called PSEdit. This cmdlet is also unique to the PowerShell ISE. The goal of PSEdit is to bring file editing for any PowerShel...

PowerTip: List All Files Open in PowerShell ISE
Jan 7, 2016
Post comments count 1
Post likes count 0

PowerTip: List All Files Open in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Get a list of all files that are currently open in the Windows PowerShell ISE.  How can I pull a list of anything that I am currently editing in the Windows PowerShell ISE?  Use this command to get the entire list of files (including the full file path) that are currently open             in the PowerShell ISE: $psISE.PowerShellTabs.files.FullPath

A Favorite PowerShell ISE Feature: Snippets
Jan 7, 2016
Post comments count 1
Post likes count 0

A Favorite PowerShell ISE Feature: Snippets

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney shows you how to get sample code in the Windows PowerShell ISE. Honorary Scripting Guy, Sean Kearney, is here today to show you a really cool feature that has been in Windows PowerShell ISE for a while, but you might have overlooked it! It’s called Snippets.    Note   This is a five-part series that includes the following posts about features in the Windows PowerShell ISE: I love using the Snippets feature on a regular basis, because although I can work in PowerShell, I don’t memorize code. I’m an IT pro, not a dev. Even my good developer friends don’t memorize...

PowerTip: Determine Which Files in ISE Are Saved
Jan 6, 2016
Post comments count 0
Post likes count 0

PowerTip: Determine Which Files in ISE Are Saved

Doctor Scripto
Doctor Scripto

Summary: Easily identify which files have been saved in the PowerShell ISE.  How can I see which of my open files in the Windows PowerShell ISE been saved?  To show a list of files that have been saved, run the following code in the ISE. $psISE.PowerShellTabs.files | where { $_.IsSaved } | Select-Object DisplayName  

A Favorite PowerShell ISE Feature: Module Browser
Jan 6, 2016
Post comments count 0
Post likes count 0

A Favorite PowerShell ISE Feature: Module Browser

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney shows you how to access modules in the PowerShell Gallery. Honorary Scripting Guy, Sean Kearney, is here today to introduce you to a feature you may not have heard of called the Module Browser for the PowerShell ISE.    Note   This is a five-part series that includes the following posts about features in the Windows PowerShell ISE: One of the newest things coming out of Microsoft is a central website called the PowerShell Gallery. This is a central repository of scripts that the community can use programmatically. A perfect example of this in action is Desired...

PowerTip: Set Zoom Level in PowerShell ISE
Jan 5, 2016
Post comments count 0
Post likes count 0

PowerTip: Set Zoom Level in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Automatically set the zoom level in the Windows PowerShell ISE.  How can I programmatically adjust the zoom for my font size in the Windows PowerShell ISE?  Set the Zoom property—for example, to adjust the font to 150%, run: $pSISE.Options.Zoom=150

A Favorite PowerShell ISE Feature: Script Browser
Jan 5, 2016
Post comments count 0
Post likes count 0

A Favorite PowerShell ISE Feature: Script Browser

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney shows you how to browse the TechNet Script Repository from the PowerShell ISE. Honorary Scripting Guy, Sean Kearney, is here today to introduce you to a pretty cool feature that is available in the Windows PowerShell ISE. It’s an add-on called the Script Browser.    Note   This is a five-part series that includes the following posts about features in the Windows PowerShell ISE: The Script Browser came with my installation yesterday when I dropped in the Script Analyzer. I referenced its existence, but I didn’t show it to you. After the installation...

PowerTip: Edit Profile for PowerShell ISE
Jan 4, 2016
Post comments count 0
Post likes count 0

PowerTip: Edit Profile for PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Identify and edit the autostart features for the Windows PowerShell ISE.  Is there something similar to the $Profile feature in the Windows PowerShell console that I can use to customize            my Windows PowerShell ISE environment?  The variable name is the same in the PowerShell ISE, but the file name it references is different, for example: Notepad $Profile If you are using the Windows PowerShell 5.0 ISE, you can use: PSEdit $Profile

A Favorite PowerShell ISE Feature: Script Analyzer
Jan 4, 2016
Post comments count 0
Post likes count 0

A Favorite PowerShell ISE Feature: Script Analyzer

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney introduces a free tool for examining your script. Honorary Scripting Guy, Sean Kearney, is here. This week I’m going to introduce you to my favorite Windows PowerShell ISE features.    Note   This is a five-part series that includes the following posts about features in the Windows PowerShell ISE: Today, I’m talking about a free add-on called the Script Analyzer. In the past, I’ve written some scripts that literally “just worked,” but I still wondered if there was something I missed. More recently I wrote a couple of modules for t...

PowerTip: Restore PowerShell ISE to Default Settings
Jan 3, 2016
Post comments count 0
Post likes count 0

PowerTip: Restore PowerShell ISE to Default Settings

Doctor Scripto
Doctor Scripto

Summary: Learn how to restore the Windows PowerShell ISE to its default configurations.  How can I restore the Windows PowerShell ISE to its default configurations?  Use the four built-in RestoreDefault methods with the PSise object to bring back everything in the ISE to the original settings: $PSise.Options.RestoreDefaults()$PSise.Options.RestoreDefaultConsoleTokenColors()$PSise.Options.RestoreDefaultTokenColors()$PSise.Options.RestoreDefaultXMLTokenColors()

Weekend Scripter: Customize PowerShell Title and Prompt
Jan 3, 2016
Post comments count 0
Post likes count 0

Weekend Scripter: Customize PowerShell Title and Prompt

Doctor Scripto
Doctor Scripto

Summary: Learn how to interactively update the Windows PowerShell prompt and title. Honorary Scripting Guy, Sean Kearney, is here today to have a little bit of fun with the Windows PowerShell console. Why not? It’s a Sunday, it’s the last day of my time off, and I feel like playing. There have been many posts online about the fun you can have with the $Host.UI.RawUI object in Windows PowerShell. You can use it to edit cursor locations, flip colors about…almost anything your little heart desires. Another fun little thing we’re going to play with is the Windows PowerShell prompt. Yes! You&r...

PowerTip: Set Personal Environment Variable from PowerShell
Jan 2, 2016
Post comments count 0
Post likes count 0

PowerTip: Set Personal Environment Variable from PowerShell

Doctor Scripto
Doctor Scripto

Summary: Access the $ENV object in Windows PowerShell to alter personal environment settings.  How can I use Windows PowerShell to change a system environment variable such as the user %TEMP%?  You can read any personal environment settings by using $ENV:VariableName, then assigning a value.            For example, to change your personal %TEMP% to a new location, use: $ENV:Temp=C:\Foo Note This presumes C:\Foo exists and will alter the variable for the present PowerShell session.

Learn Easier Way to Build Command for PowerShell.exe
Jan 2, 2016
Post comments count 0
Post likes count 0

Learn Easier Way to Build Command for PowerShell.exe

Doctor Scripto
Doctor Scripto

Summary: Learn how to parse a here-string with Windows PowerShell.Honorary Scripting Guy, Sean Kearney, is here to show you a neat little trick.Anyone who has ever scheduled a PowerShell task knows that if you want to launch a cmdlet directly in PowerShell, you would launch it like this:PowerShell.exe –ExecutionPolicy Bypass –command ‘Get-ChildItem’No challenge there. It also does not end there. You can add some down-right complex stuff in there, for example:PowerShell.exe –executionpolicy Bypass –command ‘Set-ExecutionPolicy Bypass;Import-Module DeployImage; New-WindowsP...

PowerTip: Save Help Content for Module
Jan 1, 2016
Post comments count 0
Post likes count 0

PowerTip: Save Help Content for Module

Doctor Scripto
Doctor Scripto

Summary: Learn how to target content to save with the Save-Help cmdlet.  How can I use Windows PowerShell to save the Help content for a single module?  Use the –module parameter with the Save-Help cmdlet, for example: Save-Help –module Dism –destination C:\Foo\

‘Tis the Season…for Giving Back
Jan 1, 2016
Post comments count 0
Post likes count 0

‘Tis the Season…for Giving Back

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Don Jones, discusses how you can share with the worldwide community.Today, special guest blogger, Don Jones offers ideas about how we all can increase the power of the PowerShell community…How’s your 2015 been? Hopefully, you’ve been taking advantage of some of the wonderful, free resources that are available in the global PowerShell community. Hopefully you’ve learned a new thing or two, solved a problem or two, and hoisted yourself up another rung of the PowerShell ladder.And hey…maybe in 2016, it’s time to give back a little. Oh, I know, it’s ...

PowerTip: Use Here-Strings with PowerShell
Dec 31, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Here-Strings with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn the basic use of a here-string in Windows PowerShell.  What is a here-string and how do I use it? In PowerShell, you can use here-strings to declare blocks of text. They’re declared just like regular strings except they have an @ on each end. Instead of being limited to one line, you can declare an entire block or a multiple line string. Here-strings are also useful for making a string composed of the text to execute a command. Try these examples: $String1 = @" Get-ChildItem c:\temp "@ $String2 = @" This is somemultiple line text! "@...

Sounds of the Holidays–Part 2
Dec 31, 2015
Post comments count 0
Post likes count 0

Sounds of the Holidays–Part 2

Doctor Scripto
Doctor Scripto

Summary: MVP, Thomas Rayner, continues to inspire holiday spirit by using PowerShell to trigger multimedia. Yesterday in Sounds of the Holidays–Part 1, I tried to inspire my coworker, Matthew, with some cool holiday messages. Unfortunately, Matthew is still being a Grinch and I need to step up my game. Instead of some spoken messages from “Ebenezer Script,” I’m going to play him some holiday music every time he signs in to his workstation. I’m a fan of the Charlie Brown holiday jazz album by the Vince Guaraldi Trio, and they’ve been kind enough to upload some of their music to YouTube. I’ve chosen this great pi...

PowerTip: Launch Minimized Application with PowerShell
Dec 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Launch Minimized Application with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to specify the launch state of an application through Windows PowerShell.  How can I launch a minimized application in Windows PowerShell instead of opening the window in the foreground?  Use the –WindowStyle parameter with the Start-Process cmdlet, and select Minimized, for example: Start-Process -WindowStyle Minimized 'iexplore.exe'  Note   You can also choose Hidden, Maximized, or Normal, but not all applications support all modes.

Sounds of the Holidays–Part 1
Dec 30, 2015
Post comments count 0
Post likes count 0

Sounds of the Holidays–Part 1

Doctor Scripto
Doctor Scripto

Summary: MVP, Thomas Rayner, inspires holiday spirit by using Windows PowerShell to trigger some multimedia.Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for the Scripting Guy for a couple days. You can find me on Twitter (@MrThomasRayner), or posting biweekly on my blog, WorkingSysadmin: Figuring stuff out at work. I’m enjoying some time off from work this holiday season by playing around with some of the multimedia resources that come with Windows.Do you have a coworker who you wish was a little more festive? I do. His name is Matthew, and I’m go...

PowerTip: Get Status of a DSC File in Azure
Dec 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Status of a DSC File in Azure

Doctor Scripto
Doctor Scripto

Summary: Use the Azure cmdlets to get the current status of a Desired State Configuration file on a virtual machine.  How can I use Windows PowerShell to determine if a Desired State Configuration (DSC) file that I applied to an            Azure virtual machine is successful?  Get the Azure virtual machine and pipe the object to Get-AzureVMDscExtensionStatus. The following example            checks the status on the virtual machine called Hitchy01 on the service called AzureVMNetwork: Get-AzureVM –service ‘AzureV...

PowerTip: How to Upload DSC File to Azure
Dec 28, 2015
Post comments count 0
Post likes count 0

PowerTip: How to Upload DSC File to Azure

Doctor Scripto
Doctor Scripto

Summary: Use Azure PowerShell cmdlets to send a Desired State Configuration file to be used later by a virtual machine.  How can I use Windows PowerShell to send a DSC file to be used later by a virtual machine?  Use the Publish-AzureVMDscConfiguration cmdlet and specify the path to your DSC script.            The following example targets the DSC script called FileServer.ps1: Publish-AzureVMDscConfiguration -ConfigurationPath ".\FileServer.ps1"

PowerTip: How to Upload DSC File to Azure
Dec 28, 2015
Post comments count 0
Post likes count 0

PowerTip: How to Upload DSC File to Azure

Doctor Scripto
Doctor Scripto

Summary: Use Azure PowerShell cmdlets to send a Desired State Configuration file to be used later by a virtual machine. How can I use Windows PowerShell to send a DSC file to be used later by a virtual machine? Use the Publish-AzureVMDscConfiguration cmdlet and specify the path to your DSC script.            The following example targets the DSC script called FileServer.ps1:Publish-AzureVMDscConfiguration -ConfigurationPath ".\FileServer.ps1"

PowerTip: Display Hidden Files in PowerShell
Dec 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Hidden Files in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to use Windows PowerShell to display hidden files.  How can I use Windows PowerShell to display hidden files and folders? There are a couple of approaches that use Get-ChildItem:

Weekend Scripter: Remove a Long Path File
Dec 27, 2015
Post comments count 1
Post likes count 0

Weekend Scripter: Remove a Long Path File

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to remove a file with a long path. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, the Scripting Guy. This is a continuation of this weekend series on working with PowerShell and PInvoke to do things that you normally couldn’t do natively. Also see Manage Window Placement by Using PInvoke. Today I am continuing my approach of working with PInvoke by using Add-Type to compile C# code that contains the PInvoke signatures to show that it can be pretty easy to pull together and use a Windows API when we need it. Yest...

PowerTip: Display Titles of Windows
Dec 26, 2015
Post comments count 1
Post likes count 0

PowerTip: Display Titles of Windows

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to use Windows PowerShell to find the titles of windows. How can I use Windows PowerShell to find the titles of windows? Use Get-Process and display the title of the processes for windows by looking at            the MainWindowTitle property, for example:Get-Process | Where {    $_.MainWindowTitle} |Select-Object ProcessName, MainWindowTitle ProcessName          MainWindowTitle              &nb...

Weekend Scripter: Manage Window Placement by Using PInvoke
Dec 26, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Manage Window Placement by Using PInvoke

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows us how to manage window placement in Windows PowerShell. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, the Scripting Guy. Today I start a little weekend fun by using a technique known as platform invoke, or PInvoke for short. What is PInvoke, you ask? Well, PInvoke allows us to utilize the low-level Windows API to call functions that would normally not be available to us natively. This allows us to do some pretty cool things, such as looking at files with a file path that is greater than the MAX_PATH allowed when using n...

PowerTip: Find Scripts in Script Center Repository from PowerShell ISE
Dec 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Scripts in Script Center Repository from PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Use a free add-on to directly access scripts and modules from the Windows PowerShell ISE.  In Windows PowerShell 5.0, I can access the TechNet Gallery for PowerShell modules, but is there an easy way            to access and search the older Script Center Repository from the PowerShell ISE?  In the PowerShell ISE, click Add-ons, select Script Browser Add-on Tool, and then follow the            step-by-step instructions.

A Holiday Special: Rusty the Red-Eyed Scripter, Part 5
Dec 25, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 5

Doctor Scripto
Doctor Scripto

Summary: Rusty discovers the power of classes and enums in Windows PowerShell 5.0.    Note   This is a five-part series that includes the following posts: When last we ran into our good friend Rusty, he had encountered the infamous Scripting Guy, Ed Wilson, and listened to his introduction about the ConvertFrom-String cmdlet. Now he was about to hear a session about classes. What could that possibly be about? “For many of us, this will be a new concept—the ability to create classes and other types of new and more powerful custom objects in PowerShell.” Ed looked a...

PowerTip: Convert Data to Hexadecimal Output in PowerShell 5
Dec 24, 2015
Post comments count 1
Post likes count 0

PowerTip: Convert Data to Hexadecimal Output in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Use the Format-Hex cmdlet to produce hexadecimal output.  How can I use Windows PowerShell to put data in a binary key in the registry?  In Windows PowerShell 5.0, you can use the Format-Hex cmdlet, for example: ‘This is meant to be binary’ | Format-Hex $DataForRegistry=(‘This is meant to be binary’ | Format-Hex).Bytes

A Holiday Special: Rusty the Red-Eyed Scripter, Part 4
Dec 24, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 4

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter learns how PowerShell can convert raw string data to an object.    Note   This is a five-part series that includes the following posts: Yesterday, our good friend Rusty found his head spinning with ideas after getting shown some new PowerShell cmdlets—cmdlets he could immediately put to work when using Windows PowerShell 5.0. He decided to move to the front row with Thomas to get a better view. There was some powerful stuff coming on the screen, and he didn’t want to miss a bit. “And now we have a special treat for you folks,&r...

PowerTip: Clear Recycle Bin with PowerShell 5
Dec 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Clear Recycle Bin with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Easily purge the Recycle Bin on a targeted drive with PowerShell 5.  How can I use Windows PowerShell to easily flush out the Recycle Bin?  In Windows PowerShell 5.0, use the Clear-RecycleBin cmdlet. For example, run the            following command with elevated rights to purge the Recycle Bin on drive C: Clear-RecycleBin –DriveLetter C -force

PowerTip: Clear Recycle Bin with PowerShell 5
Dec 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Clear Recycle Bin with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Easily purge the Recycle Bin on a targeted drive with PowerShell 5. How can I use Windows PowerShell to easily flush out the Recycle Bin? In Windows PowerShell 5.0, use the Clear-RecycleBin cmdlet. For example, run the            following command with elevated rights to purge the Recycle Bin on drive C:Clear-RecycleBin –DriveLetter C -force

A Holiday Special: Rusty the Red-Eyed Scripter, Part 3
Dec 23, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 3

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter learns how to unblock files and tweak event logs with Windows PowerShell 5.0.   Note   This is a five-part series that includes the following posts: Our story continues as we observe Rusty and getting his first real taste of Windows PowerShell 5.0 and discovering the power and ease-of-use it brings. Rusty and Thomas have been watching the PowerShell Saturday speaker get deeper into PowerShell—until a quick pizza break is called. Everybody ambles to the back of the room to scoop up some pizza and sodas, and the chatting begins. Rusty is ch...

A Holiday Special – Rusty the Red-Eyed Scripter: Part 3
Dec 23, 2015
Post comments count 0
Post likes count 0

A Holiday Special – Rusty the Red-Eyed Scripter: Part 3

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter learns how to unblock files and tweak event logs with Windows PowerShell 5.0.Note This is Part 3 in a five-part series. To catch up, read: Our story continues as we observe Rusty and getting his first real taste of Windows PowerShell 5.0 and discovering the power and ease-of-use it brings.Rusty and Thomas have been watching the PowerShell Saturday speaker get deeper into PowerShell—until a quick pizza break is called.Everybody ambles to the back of the room to scoop up some pizza and sodas, and the chatting begins. Rusty is chatting with Thomas, “I’d l...

PowerTip: Uninstall Module with PowerShell 5
Dec 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Uninstall Module with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to uninstall a Windows PowerShell module. How can I easily uninstall a Windows PowerShell module? Use the Uninstall-Module cmdlet to remove anything discovered by using Find-Module. For example,            to permanently remove the LocalAccount module, use:Uninstall-Module LocalAccount

PowerTip: Uninstall Module with PowerShell 5
Dec 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Uninstall Module with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to uninstall a Windows PowerShell module. How can I easily uninstall a Windows PowerShell module? Use the Uninstall-Module cmdlet to remove anything discovered by using Find-Module. For example,            to permanently remove the LocalAccount module, use:Uninstall-Module LocalAccount

A Holiday Special: Rusty the Red-Eyed Scripter, Part 2
Dec 22, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 2

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter discovers how Windows PowerShell 5.0 can pull modules from a central repository.   Note   This is a five-part series that includes the following posts: We return with Rusty sitting beside his new friend Thomas from Edmonton, all invigorated to check out Windows PowerShell 5.0. Rusty was quite interested in this PowerShell Saturday presentation about PowerShell 5 because it seems to offer a stronger level of ease-of-use from the PowerShell 1.0 version he had tried years ago. The speaker began discussing how PowerShell provides a new method ...

A Holiday Special: Rusty the Red-Eyed Scripter, Part 2
Dec 22, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 2

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter discovers how Windows PowerShell 5.0 can pull modules from a central repository.   Note  This is Part 2 in a five-part series. To get started, read Rusty the Red-Eyed Scripter, Part 1.We return with Rusty sitting beside his new friend Thomas from Edmonton, all invigorated to check out Windows PowerShell 5.0.Rusty was quite interested in this PowerShell Saturday presentation about PowerShell 5 because it seems to offer a stronger level of ease-of-use from the PowerShell 1.0 version he had tried years ago.The speaker began discussing how PowerShell provides a new ...

PowerTip: Eliminate Duplicates in PowerShell History
Dec 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Eliminate Duplicates in PowerShell History

Doctor Scripto
Doctor Scripto

Summary: Use an option in the PSReadLine module to control Windows PowerShell 5.0 history duplication. How can I make sure that there are no duplicates in my history? In Windows PowerShell 5.0 with the PSReadLineModule loaded, use the Set-PSReadLineOption            cmdlet as follows:Set-PSReadLineOption –HistoryNoDuplicates:$True

PowerTip: Eliminate Duplicates in PowerShell History
Dec 21, 2015
Post comments count 0
Post likes count 1

PowerTip: Eliminate Duplicates in PowerShell History

Doctor Scripto
Doctor Scripto

Summary: Use an option in the PSReadLine module to control Windows PowerShell 5.0 history duplication.  How can I make sure that there are no duplicates in my history?  In Windows PowerShell 5.0 with the PSReadLineModule loaded, use the Set-PSReadLineOption            cmdlet as follows: Set-PSReadLineOption –HistoryNoDuplicates:$True

A Holiday Special: Rusty the Red-Eyed Scripter, Part 1
Dec 21, 2015
Post comments count 0
Post likes count 0

A Holiday Special: Rusty the Red-Eyed Scripter, Part 1

Doctor Scripto
Doctor Scripto

Summary: Rusty the Red-Eyed Scripter discovers compressing files and working with the Clipboard in PowerShell 5.0. It’s that time again folks—time for the long awaited holiday tradition on the Hey, Scripting Guys! Blog. Get ready for some horrible music and a fun story involving PowerShell. This is our sixth year running the holiday special, so grab a relaxing beverage of your choice and sit back as we begin the watch the journey of an IT pro who has yet to use PowerShell…   Note   This is a five-part series that includes the following posts: Let me tell you a tale of...

PowerTip: Determine Size of Folder with PowerShell
Dec 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine Size of Folder with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine the size of a folder. How can I use Windows PowerShell to easily get the size of a folder structure? Use a combination of Get-Childitem and Measure-Object. For example, to see the size of the C:\Foo folder            structure in Windows PowerShell 5.0 or 4.0, use:Get-Childitem C:\Foo –file –recurse | Measure-Object –property Length -sum

PowerTip: Determine Size of Folder with PowerShell
Dec 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine Size of Folder with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine the size of a folder.  How can I use Windows PowerShell to easily get the size of a folder structure?  Use a combination of Get-Childitem and Measure-Object. For example, to see the size of the C:\Foo folder            structure in Windows PowerShell 5.0 or 4.0, use: Get-Childitem C:\Foo –file –recurse | Measure-Object –property Length -sum

Build a Better Copy-Item Cmdlet
Dec 20, 2015
Post comments count 0
Post likes count 0

Build a Better Copy-Item Cmdlet

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney investigates how to navigate file system content. Honorary Scripting Guy, Sean Kearney, is here with an early holiday gift—a way to deal with copying many files and getting some kind of progress on the update. I ran into this problem when I was duplicating file structures onto USB keys for Windows to Go a few months ago. Maybe “problem” is not the correct word. When I execute Copy-Item to duplicate a file structure, it works properly. There is, of course, some “finicky” issues. As one reader correctly pointed out the other week, one issue arises if the folder...

Build a Better Copy-Item Cmdlet
Dec 20, 2015
Post comments count 0
Post likes count 0

Build a Better Copy-Item Cmdlet

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney investigates how to navigate file system content.Honorary Scripting Guy, Sean Kearney, is here with an early holiday gift—a way to deal with copying many files and getting some kind of progress on the update.I ran into this problem when I was duplicating file structures onto USB keys for Windows to Go a few months ago. Maybe “problem” is not the correct word. When I execute Copy-Item to duplicate a file structure, it works properly. There is, of course, some “finicky” issues.As one reader correctly pointed out the other week, one issue arises if the folder name ...

PowerTip: Use PowerShell to Change Colors in PSReadline Module
Dec 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Change Colors in PSReadline Module

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell access color options in the PSReadline module. How can I use Windows PowerShell to alter the colors in the PSReadline module? Use the Set-PSReadlineOption cmdlet to alter pretty much any item.            For example, to provide a white foreground for error messages, use:Set-PSReadlineOption –ErrorForegroundColor White

Introducing the PowerShell Extension for Visual Studio Code
Dec 19, 2015
Post comments count 0
Post likes count 0

Introducing the PowerShell Extension for Visual Studio Code

Doctor Scripto
Doctor Scripto

Summary: Doug Finke, Microsoft MVP, introduces a new way to edit code. There’s a new editor in town and as with any new shiny toy, it’s a good to download, kick the tires, and give it the seven day test. The seven day test is when you install it, try it, and see if you consistently come back to it over seven days. If you don’t, then uninstall it and move on. Microsoft Visual Studio Code is code editing, redefined. It’s free, cross-platform, extensible, and it is open source. Plus, Microsoft has released PowerShell language support for it (see PowerShell Language Support for Visual Studio...

Introducing the PowerShell Extension for Visual Studio Code
Dec 19, 2015
Post comments count 0
Post likes count 0

Introducing the PowerShell Extension for Visual Studio Code

Doctor Scripto
Doctor Scripto

Summary: Doug Finke, Microsoft MVP, introduces a new way to edit code.There’s a new editor in town and as with any new shiny toy, it’s a good to download, kick the tires, and give it the seven day test. The seven day test is when you install it, try it, and see if you consistently come back to it over seven days. If you don’t, then uninstall it and move on.Microsoft Visual Studio Code is code editing, redefined. It’s free, cross-platform, extensible, and it is open source. Plus, Microsoft has released PowerShell language support for it (see PowerShell Language Support for Visual Studio Cod...

PowerTip: Contribute to the Pester Project
Dec 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Contribute to the Pester Project

Doctor Scripto
Doctor Scripto

Summary: Learn how you can add to the Pester solution. How can I contribute to Pester? On the project’s GitHub site, submit bug reports or feature requests in the Issues log,            or submit your code via a Pull Request.

PowerTip: Contribute to the Pester Project
Dec 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Contribute to the Pester Project

Doctor Scripto
Doctor Scripto

Summary: Learn how you can add to the Pester solution.  How can I contribute to Pester?  On the project’s GitHub site, submit bug reports or feature requests in the Issues log,            or submit your code via a Pull Request.

More Pester Features and Resources
Dec 18, 2015
Post comments count 0
Post likes count 0

More Pester Features and Resources

Doctor Scripto
Doctor Scripto

Summary: Dave Wyatt wraps up his week teaching us about Pester with information about more resources.    Note   This is a five-part series that includes the following posts: I hope that this series has convinced you that writing Pester tests for your code can be easy and valuable—even if I had to be fairly brief in my examples of the most essential parts of the module. Today, I want to show you a few of the other features that the module has to offer. First, coverage analysis! The term “code coverage” refers to how much of your code is actually tested. Pester can ...

More Pester Feature and Resources
Dec 18, 2015
Post comments count 1
Post likes count 0

More Pester Feature and Resources

Doctor Scripto
Doctor Scripto

Summary: Dave Wyatt wraps up his week teaching us about Pester with information about more resources.   Note   This is a five-part series that includes the following posts: I hope that this series has convinced you that writing Pester tests for your code can be easy and valuable—even if I had to be fairly brief in my examples of the most essential parts of the module. Today, I want to show you a few of the other features that the module has to offer.First, coverage analysis! The term “code coverage” refers to how much of your code is actually tested. Pester can help...

PowerTip: Use Pester to Test Functions in Module
Dec 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Pester to Test Functions in Module

Doctor Scripto
Doctor Scripto

Summary: Use Pester to test new functions in your module. How can I unit test a non-exported function in my script module? Use the InModuleScope command to execute some or all of your Pester script within the scope of            the module you’re testing.

PowerTip: Use Pester to Test Functions in Module
Dec 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Pester to Test Functions in Module

Doctor Scripto
Doctor Scripto

Summary: Use Pester to test new functions in your module.  How can I unit test a non-exported function in my script module?  Use the InModuleScope command to execute some or all of your Pester script within the scope of            the module you’re testing.

Testing Script Modules with Pester
Dec 17, 2015
Post comments count 0
Post likes count 0

Testing Script Modules with Pester

Doctor Scripto
Doctor Scripto

Summary: Dave Wyatt discusses using Pester for testing PowerShell modules.    Note   This is a five-part series that includes the following posts: Yesterday, we looked at how to use the Mock and Assert-MockCalled commands in Pester to unit test the logic in your PowerShell code without having any external dependencies. This can get a little bit trickier when you start to store your code in script modules (.psm1 files). To demonstrate this, I’ve taken the code from yesterday’s Active Directory example, placed it into a .psm1 file, and added a small change to introduce an internal function: The Tests.p...

PowerTip: Test Active Directory Script with Pester
Dec 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Test Active Directory Script with Pester

Doctor Scripto
Doctor Scripto

Summary: Use Pester to safely test script changes to Active Directory.  How can I test my Active Directory script without having it make changes to my live domain?  Use Pester’s mocking feature to test your code without using the actual Active Directory cmdlets.

Unit Testing PowerShell Code with Pester
Dec 16, 2015
Post comments count 0
Post likes count 1

Unit Testing PowerShell Code with Pester

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Dave Wyatt, discusses using Pester to analyze small pieces of Windows PowerShell code.    Note   This is a five-part series that includes the following posts: Before we get into the technical details today, let’s define a few terms. There are several categories of automated testing, all of which are used in a continuous delivery pipeline. For the purposes of Windows PowerShell code, I tend to refer to three: Unit tests A unit test is the smallest and fastest type, and it is the first thing that will be run in your pipeline. It can ...

PowerTip: Connect Pester to Automated System
Dec 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Connect Pester to Automated System

Doctor Scripto
Doctor Scripto

Summary: Learn how to incorporate Pester into an automated system.  How do I incorporate Pester into an automated system?  Use one of the features in Pester that are built for this purpose: NUnit XML export, -PassThru switch, or the            –EnableExit switch in conjunction with powershell.exe’s exit code, for example: $testResults = Invoke-Pester -PassThru -OutputFormat NUnitXml -OutputFile .\TestResults.xml

Getting Started with Pester
Dec 15, 2015
Post comments count 0
Post likes count 0

Getting Started with Pester

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Dave Wyatt explains how to get information back from Pester.    Note   This is a five-part series that includes the following posts: At the end of yesterday’s post, I showed this brief example of a .Tests.ps1 file: Today, we’ll go into more detail about what goes into these tests, and how to get information back from Pester. In the example screenshot, there are four new commands that are not part of the PowerShell language: Describe, Context, It, and Should. Describe    Defines a group of tests, and all Pester tests files must contain ...

PowerTip: Get Started with Pester Tests and PowerShell
Dec 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Started with Pester Tests and PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to start a Pester test.  How do I run Pester tests?  Place your tests into a file with a name that ends with .Tests.ps1, and then run the Invoke-Pester cmdlet.

What is Pester and Why Should I Care?
Dec 14, 2015
Post comments count 0
Post likes count 0

What is Pester and Why Should I Care?

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Dave Wyatt introduces a new test framework for PowerShell called Pester. This week we are honored to have one of the authors of Pester here with us on the Hey, Scripting Guys! Blog. It’s Dave Wyatt himself, a Cloud and Datacenter MVP. Dave, tell us all about Pester…    Note   This is a five-part series that includes the following posts: What is Pester? That’s easy to answer… Pester is a test framework for PowerShell. It provides a language that allows you to define test cases, and the Invoke-Pester cmdlet to execute these tests and ...

PowerTip: Find List of PowerShell About Topics
Dec 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Find List of PowerShell About Topics

Doctor Scripto
Doctor Scripto

Summary: Find a list of Windows PowerShell About topics.  How can I find Help topics so I can learn about various Windows PowerShell concepts?  Use Get-Help and a wildcard character, for example: Get-Help about*

Weekend Scripter: Conceptual PowerShell Help
Dec 13, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Conceptual PowerShell Help

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Tim Warner, talks about using Windows PowerShell conceptual Help.Microsoft Scripting Guy, Ed Wilson, is here. Welcome back Timothy Warner as our guest blogger today.Tim is an author and evangelist for Pluralsight, a premier online IT pro and development training company. Tim is the author of Windows PowerShell in 24 Hours, Sams Teach Yourself, a contributor at PowerShell.org, and co-organizer of the Nashville PowerShell User Group.Here’s Tim…Let’s say you need to identify and extract all email addresses from a huge text file. To solve the issue, you decide to employ the ...

PowerTip: Time How Long PowerShell Command Takes to Complete
Dec 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Time How Long PowerShell Command Takes to Complete

Doctor Scripto
Doctor Scripto

Summary: Easily time how long a Windows PowerShell command takes to complete.  How can I time how long a command takes to complete in Windows PowerShell?  Use the Measure-Command cmdlet—for example, to time how long it takes to Get-Process (gps is an alias)            to complete, put the command in a script block and call Measure-Command: Measure-Command {gps}

Weekend Scripter: PowerShell ASCII Bar Charts
Dec 12, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell ASCII Bar Charts

Doctor Scripto
Doctor Scripto

Summary: Microsoft PFE, Wei Hao Lim, presents a script that creates ASCII bar charts. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a new guest blogger. Please welcome Wei Hao Lim. Wei is a Microsoft PFE from Australia who works primarily with enterprise customers helping to configure, deploy, maintain, and customize System Center implementations. In his spare time, he enjoys video editing, swimming, playing with board games, and video games. He writes a very popular blog named Wei Out There with System Center. Here’s Wei… This article features a sample PowerShell script that generates a...

PowerTip: Find Module Path with Windows PowerShell
Dec 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Module Path with Windows PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine the location of a module.  How can I use Windows PowerShell to find the location of a module that I am using from a vendor?  Use the Path property of the module with Split-Path to show the parent: $ModuleName=(Get-Module –module DeployImage) $ModulePath=Split-Path $ModuleName

Using DeployImage and Windows PowerShell to Build a Nano Server: Part 5
Dec 11, 2015
Post comments count 0
Post likes count 0

Using DeployImage and Windows PowerShell to Build a Nano Server: Part 5

Doctor Scripto
Doctor Scripto

Summary: Use the DeployImage module to build bootable Windows PE media with deployment content.Honorary Scripting Guy, Sean Kearney, is here today to show you one of my favorite pieces of my DeployImage module—building a piece of bootable USB media that has everything I need to deploy Nano Server.   Note   This is a five-part series that includes the following posts: Last week in the series, Build a PowerShell-Enabled Windows PE Key, I talkedl about building a Windows PE USB key with Windows PowerShell. This week, I explored how to use the new DeployImage module to build out Na...

PowerTip: Escape Parsed Content in PowerShell String
Dec 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Escape Parsed Content in PowerShell String

Doctor Scripto
Doctor Scripto

Summary: Use the backtick character to insert data normally parsed by Windows PowerShell in a string.  Certain characters (such as the colon and double quotation marks) are special in Windows PowerShell.            How can I use those in a parsed string?  Use the backtick character (usually under the tilde, and it’s also ASCII character 96), for example: $OSDrive=’C’ $DriveLetter=”$OSDrive`:”

Using DeployImage and Windows PowerShell to Build a Nano Server: Part 4
Dec 10, 2015
Post comments count 0
Post likes count 0

Using DeployImage and Windows PowerShell to Build a Nano Server: Part 4

Doctor Scripto
Doctor Scripto

Summary: Use the new cmdlets in the DeployImage module to simplify the deployment of a Nano Server.Honorary Scripting Guy, Sean Kearney, is here to get into the really fun part of deploying a Nano Server—the actual deployment part.   Note   This is a five-part series that includes the following posts: Yesterday, I showed you the New-UnattendXMLContent cmdlet to help you name the Nano Server and provide direct settings, such as the time zone. Today we’re going to look at creating partitions and applying the image—our actual process.If you were to try to apply Nano Se...

PowerTip: Use PowerShell to Create Module Manifest
Dec 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create Module Manifest

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to build a module manifest for GitHub.  How can I use Windows PowerShell to build a module manifest for my module in GitHub?  In Windows PowerShell 5.0 use the New-ModuleManifest cmdlet—for example, to create a sample            manifest in the C:\Foo folder, type: New-ModuleManifest –path C:\Foo\Sample.PSD1 Note This creates a full module manifest, including comments. This cmdlet also accepts parameters for some key points of data.

Use DeployImage Module and PowerShell to Build a Nano Server: Part 3
Dec 9, 2015
Post comments count 0
Post likes count 0

Use DeployImage Module and PowerShell to Build a Nano Server: Part 3

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney uses the New-UnattendXMLContent cmdlet in his DeployImage module to automate naming the Nano Server. Honorary Scripting Guy, Sean Kearney, is here today to continue with our work in easing the deployment of a Nano Server or other WIM files with the DeployImage module.    Note   This is a five-part series that includes the following posts: But most of us are used to going to a computer, swapping in the computer name, and joining the domain via the GUI. But this is not the only way to do it. If you’re just getting into deploying Windows or images, there is...

PowerTip: Add CAB Package to Windows Image with PowerShell
Dec 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Add CAB Package to Windows Image with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to update a Windows image with a CAB package. How can I use Windows PowerShell to update a Windows image with a new CAB package?Supply the path to the package and use the Add-WindowsPackage cmdlet. For example, to add a            package to a previously mounted offline installation in the C:\Media\Mount folder, use:Add-WindowsPackage –PackagePath C:\Foo\Somepackage.CAB –Path C:\Media\Mount

Use DeployImage Module and PowerShell to Build a Nano Server: Part 2
Dec 8, 2015
Post comments count 0
Post likes count 0

Use DeployImage Module and PowerShell to Build a Nano Server: Part 2

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney uses the New-NanoServerWim cmdlet from the DeployImage module to build an updated Nano Server WIM file. Honorary Scripting Guy, Sean Kearney, is here today continuing forward with creating a new Nano Server with the DeployImage module.    Note   This is a five-part series that includes the following posts: I’m presuming that you have the media for the Nano Server ready, and it is sitting off the NanoServer folder at the root of the Windows Server 2016 TP4 media. To customize the Nano Server WIM file, we use the same process as customizing any other WIM f...

PowerTip: Use PowerShell to Remove Drive Letter
Dec 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Remove Drive Letter

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to remove an assigned drive letter from a partition.  How can I use Windows PowerShell to remove a drive letter from a partition?  Use a combination of three cmdlets with the drive letter—for example, to remove drive letter X from the drive            it is assigned to, use $DriveLetter=’XGet-Volume -Drive $DriveLetter | Get-Partition | Remove-PartitionAccessPath -accesspath "$DriveLetter`:\"

Use DeployImage Module and PowerShell to Build a Nano Server: Part 1
Dec 7, 2015
Post comments count 0
Post likes count 0

Use DeployImage Module and PowerShell to Build a Nano Server: Part 1

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney introduces his DeployImage module and the cmdlets for Nano Server.Honorary Scripting Guy, Sean Kearney, is here this week giving Ed a little early holiday rest and showing you a bit about Nano Server.   Note   This is a five-part series that includes the following posts: One of the challenges we all need to deal with in our environments is security. One of the biggest security headaches is patching. Patching means one big headache: rebooting the server. The reason rebooting that server is a headache is that it often means an interruption in business operations o...

PowerTip: Get Author Information about PowerShell Session Configuration
Dec 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Author Information about PowerShell Session Configuration

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get session owner information.  How can I get more information about which Windows PowerShell session configurations came with            my system and which were set up by another administrator?  Use Get-PssessionConfiguration and target the Name and Author properties, for example: Get-PssessionConfiguration | Select-Object –Property Name,Author | Format-Table -autosize

Weekend Scripter: Taking JEA for a Spin—Part 2
Dec 6, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Taking JEA for a Spin—Part 2

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner explores how to restrict Active Directory management with JEA in Windows Server 2016. Thomas Rayner, Cloud and Datacenter Management MVP, continues his two-part series about an exciting new feature in Windows Server 2016, Just Enough Admin (JEA). Today we’ll investigate how JEA can be applied in a situation where a limited user has permissions to run specific Active Directory queries. Yesterday in Taking JEA for A Spin—Part 1, I tackled code promotion. I showed how to configure JEA so that a connecting user could run only a specially crafted script. Today, the example use case I...

PowerTip: Use PowerShell to Identify Endpoints on Server
Dec 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Identify Endpoints on Server

Doctor Scripto
Doctor Scripto

Summary: Learn how to identify endpoints on a server.  How can I use Windows PowerShell to see the available endpoints on a server if I have the necessary rights?  Use the Get-PSSessionConfiguration cmdlet.

Weekend Scripter: Taking JEA for a Spin—Part 1
Dec 5, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Taking JEA for a Spin—Part 1

Doctor Scripto
Doctor Scripto

Summary: Thomas Rayner explores code promotion with Just Enough Admin (JEA) in Windows Server 2016. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy this weekend. You can find me on Twitter (@MrThomasRayner). I also post my blog bi-weekly: Working Sysadmin—Figuring stuff out at work. The temperature is dropping and the snow is starting to fly here in Alberta, Canada so I’m going to stay in this weekend and take an awesome new feature in Windows Server 2016, Just Enough Admin (JEA), for a spin. I’ll explore how it can be ...

PowerTip: Use PowerShell to List All Volumes
Dec 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to List All Volumes

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to identify all partitions on a disk drive.  How can I use Windows PowerShell to easily see all of the partitions on a disk drive?  Pipe the Disk object through Get-Partition (to identify its partitions), then pipe that through Get-Volume to get            the volume data. Here is an example of using this on the default hard drive (drive 0): Get-Disk –number 0 | Get-Partition | Get-Volume

Build a PowerShell-Enabled Windows PE Key: Part 5
Dec 4, 2015
Post comments count 0
Post likes count 0

Build a PowerShell-Enabled Windows PE Key: Part 5

Doctor Scripto
Doctor Scripto

Summary: Populate a bootable USB key with content from Windows PE. Honorary Scripting Guy, Sean Kearney, is here today sharing all you need to know about having a Windows PE key with Windows PowerShell.   Note   This is a five-part series that includes the following posts: Let’s remember that we’ve got that bootable USB key—a complete structure from Windows PE—sitting on our hard drive…a full tank of gas! (Oops! Sorry! I was watching Blues Brothers last night.) Our folder structure in question sits in the Media folder under the structure defined by $WinPEtemp. ...

PowerTip: Duplicate File Structure with PowerShell
Dec 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Duplicate File Structure with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Copy-Item to duplicate content with Windows PowerShell.  How can I use Windows PowerShell to duplicate content?  Use Copy-Item—for example, to duplicate all files and folders from C:\Foo to D:\Foo, run: Copy-Item C:\Foo D:\Foo -recurse

Build a PowerShell-Enabled Windows PE Key: Part 4
Dec 3, 2015
Post comments count 0
Post likes count 0

Build a PowerShell-Enabled Windows PE Key: Part 4

Doctor Scripto
Doctor Scripto

Summary: Build out the necessary file structure for a Windows PE environment.Honorary Scripting Guy, Sean Kearney, is here today to give you all you need to build out your own Windows PE file structure.   Note   This is a five-part series that includes the following posts: Let’s think about what we’ve developed in the first three parts of this series: Our next task is to pull all of this together into a file structure for Windows PE.Confused?Normally, we would take a Windows image file and expand it directly to the target file system. But not with Windows PE. A Windows PE e...

PowerTip: Use PowerShell to Build Simple Menu
Dec 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Build Simple Menu

Doctor Scripto
Doctor Scripto

Summary: Use the Out-Gridview cmdlet to easily build a GUI menu.  How can I easily build a GUI menu in Windows PowerShell so I can select items from a list?  Pipe any array to the Out-Gridview cmdlet and you can capture the results! ‘AddUser’,’RemoveUser’,’DeleteUser’,’ExitSystem’ | Out-Gridview -passthru

Build a PowerShell-Enabled Windows PE Key: Part 3
Dec 2, 2015
Post comments count 0
Post likes count 0

Build a PowerShell-Enabled Windows PE Key: Part 3

Doctor Scripto
Doctor Scripto

Summary: Identify available USB keys and make them bootable devices. Honorary Scripting Guy, Sean Kearney, is here to continue delving into having a cool PowerShell experience in a Windows PE environment. Today I’m going to show you how to use Windows PowerShell to identify USB keys and make them bootable devices.    Note   This is a five-part series that includes the following posts: With Windows PowerShell finding a USB key is actually quite easy. We just use the Get-Disk cmdlet. This will show us all disks on the computer. There is a property we can filter on called BusType. A ...

PowerTip: See All Images Contained in Windows Image File
Dec 1, 2015
Post comments count 0
Post likes count 0

PowerTip: See All Images Contained in Windows Image File

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to identify all available images in a WIM file.  How can I use Windows PowerShell to see what images are stored in a WIM file?  Use the Get-WindowsImage cmdlet and target the WIM file, for example: Get-WindowsImage –imagepath Install.wim

Build a PowerShell-Enabled Windows PE Key: Part 2
Dec 1, 2015
Post comments count 0
Post likes count 0

Build a PowerShell-Enabled Windows PE Key: Part 2

Doctor Scripto
Doctor Scripto

Summary: Customize a Windows PE environment to contain Windows PowerShell and DISM modules.Honorary Scripting Guy, Sean Kearney, is here again today with some early holiday gifts! A little PowerShell in a mean, lean green environment!   Note   This is a five-part series that includes the following posts: Now that we have the necessary software installed in Windows to build out a Windows PE environment, let’s take a look at building it.The Windows PE environment is pretty neat because most of the actual boot environment is ready for you. But the actual “live environment” ...

PowerTip: Determine Windows Architecture with PowerShell
Nov 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine Windows Architecture with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to identify whether you are running a 32-bit or 64-bit version of Windows.  How can I use Window PowerShell to see if my version of Windows is 32-bit or 64-bit?  Use Get-CimInstance and query the OSArchitecture property: (Get-CimInstance Win32_operatingsystem).OSArchitecture  

Build a PowerShell-Enabled Windows PE Key: Part 1
Nov 30, 2015
Post comments count 0
Post likes count 0

Build a PowerShell-Enabled Windows PE Key: Part 1

Doctor Scripto
Doctor Scripto

Summary: Sean Kearney explores installing the Windows ADK and validating its presence with Windows PowerShell. Honorary Scripting Guy, Sean Kearney, here filling in for The Scripting Guy. This week, I’m going to help you out with Windows PE.    Note   This is a five-part series that includes the following posts: First, we need to explore “what is Windows PE?” Windows Preinstallation Environment (Windows PE) is a very light version of Windows that is intended for deployment solutions. A perfect example (and one we’ll delve into next week) is when you need to deploy Nan...

PowerTip: Update Module from PowerShell Gallery
Nov 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Update Module from PowerShell Gallery

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to update a module from the Windows PowerShell Gallery. How can I update a module from the Windows PowerShell Gallery? Run the following command to check for an update to the module and install the update if one is found:Update-Module –Name PoshRSJob –VerboseVERBOSE: Checking for updates for module 'PoshRSJob'.VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.VERBOSE: The specified Location is 'https://www.powershell...

Weekend Scripter: A Look at the PoshRSJob Module
Nov 29, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: A Look at the PoshRSJob Module

Doctor Scripto
Doctor Scripto

Summary: Boe Prox presents a module for working with runspaces. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. Today I finish up my series about using runspaces in PowerShell by showing you a module that I put together that makes working with runspaces a lot easier. Note   This is a four-part series that includes the following posts: There are some great scripts out there that provide a tool to work with runspaces, such as Invoke-Parallel. I wanted to come up with something that would provide a famil...

PowerTip: Add Custom Function to Runspace Pool
Nov 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Add Custom Function to Runspace Pool

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to add a custom function to a runspace pool. How can I use Windows PowerShell to add a custom function to a runspace pool? Use the following approach:#Custom FunctionFunction ConvertTo-Hex {    Param([int]$Number)    '0x{0:x}' -f $Number}#Get body of function$Definition = Get-Content Function:\ConvertTo-Hex -ErrorAction Stop#Create a sessionstate function entry$SessionStateFunction = New-Object System.Management.Automation.Runspaces.SessionStateFunctionEntry -ArgumentList 'ConvertTo-Hex', $Definition#Create a SessionStateFunction$InitialSessionSt...

Beginning Use of PowerShell Runspaces: Part 3
Nov 28, 2015
Post comments count 8
Post likes count 0

Beginning Use of PowerShell Runspaces: Part 3

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows us some tips about using runspace pools for multithreading. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. Note   This is a four-part series that includes the following posts: After spending the past couple of days working with runspaces and looking at how we can use parameters and arguments to supply variables to our runspaces, we are taking the next step in our journey by looking at runspace pools to do some multithreading with multiple commands. The process for working with...

PowerTip: Get the Async Object Created by BeginInvoke
Nov 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Get the Async Object Created by BeginInvoke

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how retrieve a seemingly lost Async object from a runspace. How can I get the seemingly lost Async object created by BeginInvoke? Use Reflection to pull this information out of a Runspace object and get the Async object, which is required            to use with EndInvoke().$Runspace = [runspacefactory]::CreateRunspace()$PowerShell = [powershell]::Create()$Runspace.Open()$PowerShell.Runspace = $Runspace[void]$PowerShell.AddScript({    [pscustomobject]@{        Name = 'Boe ...

Beginning Use of PowerShell Runspaces: Part 2
Nov 27, 2015
Post comments count 0
Post likes count 0

Beginning Use of PowerShell Runspaces: Part 2

Doctor Scripto
Doctor Scripto

Summary: Boe Prox presents some tips about beginning use with runspaces. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. Note   This is a four-part series that includes the following posts: Yesterday, we spent some time looking at how we can create a runspace that can be used to run a command in the background while leaving our console wide open for us to continue running commands. Although using what we have learned will make it easier to push commands to the background, we are currently limited to o...

PowerTip: Find Current Runspaces in PowerShell
Nov 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Current Runspaces in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to find the current runspaces in Windows PowerShell.  How can I list all of the currently running runspaces in Windows PowerShell? Use the Get-Runspace cmdlet in Windows PowerShell 5.0:Get-RunspaceId Name      ComputerName    Type      State       Availability--   ----            ------------            ----        -----         ------------ 1 Runspace1  ...

Beginning Use of PowerShell Runspaces: Part 1
Nov 26, 2015
Post comments count 0
Post likes count 0

Beginning Use of PowerShell Runspaces: Part 1

Doctor Scripto
Doctor Scripto

Summary: Boe Prox presents some tips about beginning use with runspaces. Honorary Scripting Guy and Cloud and Datacenter Management MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. Note   This is a four-part series that includes the following posts: Let's say you are working in PowerShell and you want to kick off something to run in the background while you are working on some other things in the console. You would usually use something related to PSJobs, such as the *-Job cmdlets. Or you might use the –Asjob parameter that you see in some cmdlets, such as Get...

PowerTip: Create Function List and Find PowerShell Files
Nov 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Create Function List and Find PowerShell Files

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to create a function list and find files.  How can I use Windows PowerShell to avoid repetitively typing “ls . –r *.ps1” to get a list of PowerShell files and then           “ls . –r *.ps1 | sls function” to search the content of those files for a string?  Add this function to your PowerShell profile: function fps ($find) {         "Get-ChildItem . -Recurse *.ps1 $(if($find) { "| Select-String $find" })" |        ...

Introducing the PowerShell Excel Module
Nov 25, 2015
Post comments count 0
Post likes count 0

Introducing the PowerShell Excel Module

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Doug Finke talks about his PowerShell Excel module. The PowerShell Excel Module is a brand new, exciting, and better way to interact with Microsoft Excel from Windows PowerShell. Plus for bonus points, you don’t need Excel installed on the target machine to create the spreadsheet. Many users of this module generate Excel spreadsheets on servers, and then others in the company pick up the reports from a central server. Or for the last step in their script, they can mail the .xlsx file. The challenge Until now, there have been a few ways to get data into Excel. One way is to creat...

Introducing the PowerShell Excel Module
Nov 25, 2015
Post comments count 0
Post likes count 1

Introducing the PowerShell Excel Module

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Doug Finke talks about his PowerShell Excel module.The PowerShell Excel Module is a brand new, exciting, and better way to interact with Microsoft Excel from Windows PowerShell. Plus for bonus points, you don’t need Excel installed on the target machine to create the spreadsheet. Many users of this module generate Excel spreadsheets on servers, and then others in the company pick up the reports from a central server. Or for the last step in their script, they can mail the .xlsx file.The challengeUntil now, there have been a few ways to get data into Excel. One way is to create a comm...

PowerTip: Store Current Pipeline Value in Variables with PowerShell
Nov 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Store Current Pipeline Value in Variables with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell to store current pipeline values in variables. How can I use Windows PowerShell to improve my code by storing the current pipeline value into variables? Use the new PipelineVariable common parameter, for example:Get-Counter -ListSet 'LogicalDisk','SQLServer:Buffer Manager','SQLServer:Memory Manager' -PipelineVariable CounterCategory | Select-Object -ExpandProperty Counter -PipelineVariable CounterName |Where-Object {$CounterName -match '(sec/Transfer|Avg. Disk Queue Length|Buffer Cache|CheckPoint|Target Server|Total)'} | Select-Object   @{E={$CounterCategory.Counte...

Automating Index Fragmentation Reports
Nov 24, 2015
Post comments count 0
Post likes count 0

Automating Index Fragmentation Reports

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Laerte Junior discusses how to use PowerShell to automate an index fragmentation report and generate an Excel file.One of the day-to-day tasks of a DBA is to maintain your environment. This task includes checking the fragmentation of indexes. In this post, I will show how to automate this collection and generate an Excel file.Environment considerationsFor this particular script, I am assuming that like me, you use a central “collector” machine. For that, you have installed SQL Server 2012 or later, Excel, and Windows PowerShell 4.0 or later. Yes! I will use some coding features...

Automating Index Fragmentation Reports
Nov 24, 2015
Post comments count 0
Post likes count 0

Automating Index Fragmentation Reports

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Laerte Junior discusses how to use PowerShell to automate an index fragmentation report and generate an Excel file.One of the day-to-day tasks of a DBA is to maintain your environment. This task includes checking the fragmentation of indexes. In this post, I will show how to automate this collection and generate an Excel file.Environment considerationsFor this particular script, I am assuming that like me, you use a central “collector” machine. For that, you have installed SQL Server 2012 or later, Excel, and Windows PowerShell 4.0 or later. Yes! I will use some coding features...

PowerTip: Use PowerShell to Generate Object with Two Property Types
Nov 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Generate Object with Two Property Types

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to generate an object with two property types. How can I use Windows PowerShell to generate an object with two property types from simply splitting a string? Use the ConvertFrom-String cmdlet to pipe a string, and then specify the desired property types, for example:PS C:\>“123 456” | ConvertFrom-String –PropertyType String,Int 

PowerTip: Use PowerShell to Generate Object with Two Property Types
Nov 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Generate Object with Two Property Types

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to generate an object with two property types.  How can I use Windows PowerShell to generate an object with two property types from simply splitting a string?  Use the ConvertFrom-String cmdlet to pipe a string, and then specify the desired property types, for example: PS C:\>“123 456” | ConvertFrom-String –PropertyType String,Int  

Get Wireless Network SSID and Password with PowerShell
Nov 23, 2015
Post comments count 0
Post likes count 0

Get Wireless Network SSID and Password with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Jason Walker explores using Windows PowerShell to get the SSID and password for a wireless network. Ed Wilson, Microsoft Scripting Guy is here. Today I'm turning over the keyboard to Jason Walker. Jason is an Office 365 deployment consultant, who assists customers in the public sector arena. Here's Jason... Let me start off with a scenario. You are somewhere, anywhere, and a friend of yours asks you for the password to a wireless network. This could be the wireless network at your house or a hotspot. What do you do? In Windows 7, you could easily get that from a viewable preferred wireless netw...

PowerTip: Find Expiring Certificates by Using PowerShell
Nov 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Expiring Certificates by Using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how you can find certificates that are expiring.  How can I find if I have any certificates on my system that are expiring within 30 days?  Use the ExpiringInDays dynamic parameter when working with the certificate provider, for example: Get-ChildItem Cert:\LocalMachine\My\ -ExpiringInDays 30 | Select-Object Thumbprint, Subject, NotAfter

Weekend Scripter: Report on Network Level Authentication
Nov 22, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Report on Network Level Authentication

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to use Windows PowerShell to report on Network Level Authentication. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. I plan to spend this Sunday showing you how you can report on whether your systems are enabled for Network Level Authentication. By using PowerShell, we can make some amazing scripts and functions that can do a variety of things. Whether we want to build a complex workflow to provision a system, use Desired State Configuration to configure many systems, or even build a UI, we can pretty much do any...

PowerTip: Find Free Commands in PowerShell 5
Nov 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Free Commands in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to find free commands in Windows PowerShell 5.0.  I would like to customize my command line experience in Windows PowerShell 5.0, but I don’t want to write            a lot of code. How can I find available commands that are not bound to any keyboard chord sequence?  Use the Get-PSReadlineKeyHandler and look for unbound commands: (Get-PSReadlineKeyHandler).where({$_.key -eq 'unbound'})

Weekend Scripter: The Case of the Disappearing PowerShell Console
Nov 21, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: The Case of the Disappearing PowerShell Console

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about fixing a problem where his Windows PowerShell console disappears. Microsoft Scripting Guy, Ed Wilson, is here. So there I was, on a two week trip, out of time, with only my laptop, and I needed to use Windows PowerShell. Most of the time, I use the Windows PowerShell console, but I do occasionally use the Windows PowerShell ISE. At home, I have a nice-sized second monitor that is attached to my laptop—but I do not—actually the truth is, I rarely travel with my second monitor. I have been known to take it with me on a road trip. So I click to ope...

PowerTip: Use PowerShell to Show Deployment Types for Application
Nov 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Show Deployment Types for Application

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to identify all deployment types for an application.  How can I use Windows PowerShell to pull up a list of all deployment types for one of my applications?  Use the Get-CmDeploymentType cmdlet and supply the application name in question, for example: Get-CmDeploymentType –ApplicationName ‘HSG Application’ | Select-Object LocalizedDisplayName

PowerShell and Configuration Manager 2012 R2–Part 5
Nov 20, 2015
Post comments count 0
Post likes count 0

PowerShell and Configuration Manager 2012 R2–Part 5

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to create an application. Oh, Scripting Guy! I want to get home at a decent hour today, but I need to bring this massive list of applications into Configuration Manager. I heard the Configuration Manager cmdlets can do this, but I need some help. So…er…*Cough*...HELP! —TR Hello TR, Honorary Scripting Guy, Sean Kearney, is here today to help you. I know vividly what you’re talking about. I’ve had to do the same thing.  Note  This is a five-part series that includes the following posts: Configuration Manager is a great environme...

PowerTip: Use PowerShell to Identify Network Drivers in Configuration Manager
Nov 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Identify Network Drivers in Configuration Manager

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets in Windows PowerShell to identify all network drivers.  I deal with drivers detection issues in Windows PE because we have too many network card drivers.           How can I use Windows PowerShell to quickly show all of the network drivers in Configuration Manager?  Use the Get-CmDriver cmdlet and filter on the DriverClass property, for example: $DriverClass=’Net’ Get-CmDriver | Where { $_.DriverClass –match $DriverClass } You can pipe this object to Select-Object to choose the in...

PowerShell and Configuration Manager 2012 R2–Part 4
Nov 19, 2015
Post comments count 0
Post likes count 0

PowerShell and Configuration Manager 2012 R2–Part 4

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to work with driver packages.  Hey, Scripting Guy! My current job involves creating packages in Configuration Manager 2012. Is there some way to automate the process? It’s not that it’s actually difficult, but it is a very repeatable process. I thought to myself, “Repeatable? This sounds like a job for PowerShell!" Help out a friend and tell me there are cmdlets to do this. —KB  Hello KB, Honorary Scripting Guy, Sean Kearney, is here today with relief for you. Yes, there are cmdlets for that! If you’ve been following along this week, you have seen t...

PowerTip: Get List of Distribution Points with PowerShell
Nov 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Get List of Distribution Points with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the PowerShell cmdlets in Configuration Manager to pull a list of all distribution points.  How can I get an easy-to-read list of the distribution points in a site?  Load the Configuration Manager 2012 cmdlets, and run the following one-liner in PowerShell: Get-CMDistributionPoint | Select-Object NetworkOsPath,RoleName,SiteCode

PowerShell and Configuration Manager 2012 R2–Part 3
Nov 18, 2015
Post comments count 0
Post likes count 0

PowerShell and Configuration Manager 2012 R2–Part 3

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to update applications in distribution points.  Hey, Scripting Guy! I’m forever having the nightmare of going clickity, click, click, click when I’m working with my distribution points—especially when updating applications and packages. There must be some way to do this in Windows PowerShell. Can you help me? —DS  Hello DS, Honorary Scripting Guy, Sean Kearney, is here, shedding more light on the Configuration Manager cmdlets!  Note  This is a five-part series that includes the following posts: I feel your pain. Whenever I ...

PowerTip: List Collections in Configuration Manager
Nov 17, 2015
Post comments count 0
Post likes count 0

PowerTip: List Collections in Configuration Manager

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to show all available User and Device collections.  How can I use Windows PowerShell to list all the available User and Device collections in Configuration Manager 2012,            and then export the list to a file?  Use the Get-CMCollection cmdlet with Export-CSV, for example: Get-CMCollection | Export-CSV Collectionlist.csv

PowerShell and Configuration Manager 2012 R2–Part 2
Nov 17, 2015
Post comments count 0
Post likes count 0

PowerShell and Configuration Manager 2012 R2–Part 2

Doctor Scripto
Doctor Scripto

Summary: Use the Configuration Manager cmdlets to work with site collections.  Hey, Scripting Guy! I deal with Configuration Manager on a regular basis, and I have to manage User and Device collections. I’d like an easier way to add and remove members and audit the memberships of site collections. Could you show me how to do that with the cmdlets in Configuration Manager? —RL A: Hello RL, Honorary Scripting Guy, Sean Kearney, is here to further delve into some basic uses of those ever so magical Configuration Manager cmdlets.  Note  This is a five-part series that includes the following posts: ...

PowerTip: Find Version of Configuration Manager
Nov 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Version of Configuration Manager

Doctor Scripto
Doctor Scripto

Summary: Use PowerShell cmdlets to identify the current version and build number of a Configuration Manager site.  How can I use Windows PowerShell to find the current version and build number for a client's            Configuration Manager site?  When you have the cmdlets for Configuration Manager 2012 or later loaded into the Windows PowerShell            console, execute this line to display the information: Get-CmSite | Select-Object Servername,SiteCode,BuildNumber,Version

PowerShell and Configuration Manager 2012 R2–Part 1
Nov 16, 2015
Post comments count 0
Post likes count 0

PowerShell and Configuration Manager 2012 R2–Part 1

Doctor Scripto
Doctor Scripto

Summary: Load the Configuration Manager cmdlets and make a basic site connection.  Hey, Scripting Guy! I’ve been doing a lot of work in the Configuration Manager 2012 R2 console and it’s beautiful. But I find I spend a lot of my time clicking all over the place and repeating tasks. Are there PowerShell cmdlets available that I can use? —SH  Hello SH, Honorary Scripting Guy, Sean Kearney, is here today to give you the answer you want, which is, “Yes!” There absolutely are cmdlets for Windows PowerShell in Configuration Manager 2012 R2, and boy, are they cool! I’ve had to do some repetitive tasks in ...

PowerTip: Move PowerShell ISE Command Pane Left
Nov 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Move PowerShell ISE Command Pane Left

Doctor Scripto
Doctor Scripto

Summary: Show the Windows PowerShell ISE command pane on the left side of the screen.  How can I split the PowerShell ISE screen vertically so I can see the screen pane on the right and the            command pane on the left?  To show a vertical configuration, select Show Script Pane Right from the View menu. Or use <CTRL-2>            to show the script pane on the right, and use <CTRL-1>to go back to the horizontal configuration.

Weekend Scripter: Great PowerShell ISE Features for Beginners
Nov 15, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Great PowerShell ISE Features for Beginners

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about some of the greatest Windows PowerShell ISE features for beginners. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about the Windows PowerShell ISE is that it can help a wide level of scripters. For example, if you are very experienced with Windows PowerShell, there is an API that can be used to create your own add-ons for the Windows PowerShell ISE. This can help to smooth many of the rough spots that sometimes annoy users of the Windows PowerShell ISE. I love this feature. But when I am teaching Windows PowerShell to beginners, I don...

PowerTip: Toggle Command Add-on in PowerShell ISE
Nov 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Toggle Command Add-on in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Learn how to enable the Command Add-on for the Windows PowerShell ISE.  I use different computers, and the Command Add-on is displayed only sometimes. I would like to display            this add-on as required. How can I do this?  Select Show Command Add-on from the View menu in the Windows PowerShell ISE.

Weekend Scripter: PowerShell ISE Not Only for Scripts
Nov 14, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell ISE Not Only for Scripts

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about why you may want to use the Windows PowerShell ISE instead of the console.Microsoft Scripting Guy, Ed Wilson, is here. I was speaking at a Windows PowerShell user group recently. After the presentation, someone came up to me and said that the Windows PowerShell ISE was rather confusing. Because he did not write scripts, he had not taken the time to learn how to use the ISE. Instead, if any Windows PowerShell needed “to be done,” he simply opened the Windows PowerShell console, typed away—and that was that.Cool. I use the Windows PowerShell...

PowerTip: Revert PowerShell ISE Token Values
Nov 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Revert PowerShell ISE Token Values

Doctor Scripto
Doctor Scripto

Summary: Learn how to revert Windows PowerShell ISE token values to default values.  I have been playing with token colors in the Windows PowerShell ISE and things are confused.            How can I use Windows PowerShell to change back to default values.?  Use the RestoreDefaultTokenColors method from the Options object: $psISE.Options.RestoreDefaultTokenColors()

Set PowerShell ISE to Default Values
Nov 13, 2015
Post comments count 0
Post likes count 0

Set PowerShell ISE to Default Values

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about resetting the Windows PowerShell ISE settings to the defaults. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about Windows PowerShell is that it is highly configurable. Not only the things that I can configure, but Windows PowerShell itself. The behaviors in the Windows PowerShell console and the Windows PowerShell ISE can be quickly changed. One of the best ways to do this is to use a Windows PowerShell profile. I like to create specific profiles for certain environments instead of one big monolithic profile. In fact, I like to use m...

PowerTip: Toggle Outlining View in PowerShell ISE
Nov 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Toggle Outlining View in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Toggle between outlining view in the Windows PowerShell ISE. How can I switch to the outlining view in the Windows PowerShell ISE to collapse           the functions so it is easier to read the code?   Use the ToggleOutliningExpansion function from the Editor object, for example:$psise.CurrentFile.Editor.ToggleOutliningExpansion()

PowerTip: Toggle Outlining View in PowerShell ISE
Nov 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Toggle Outlining View in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Toggle between outlining view in the Windows PowerShell ISE.  How can I switch to the outlining view in the Windows PowerShell ISE to collapse           the functions so it is easier to read the code?    Use the ToggleOutliningExpansion function from the Editor object, for example: $psise.CurrentFile.Editor.ToggleOutliningExpansion()

Use Regions in PowerShell ISE
Nov 12, 2015
Post comments count 0
Post likes count 0

Use Regions in PowerShell ISE

Radhika Tadinada
Radhika Tadinada

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using regions in the Windows PowerShell ISE.  Hey, Scripting Guy! I like using the Windows PowerShell ISE. The price is right I guess. There is one thing that kind of bugs me, however.  When I am writing a long script, there is too much scrolling, and things seem to slow down. I wish there was a way that I did not have to deal with lines and lines of script. I guess I can move the functions into a module, but that adds more complexity than I want in my life right now. Is there something that can help? —RR  Hello RR, Microsoft Scripting Guy, Ed W...

Use Regions in PowerShell ISE
Nov 12, 2015
Post comments count 0
Post likes count 0

Use Regions in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using regions in the Windows PowerShell ISE. Hey, Scripting Guy! I like using the Windows PowerShell ISE. The price is right I guess. There is one thing that kind of bugs me, however.  When I am writing a long script, there is too much scrolling, and things seem to slow down. I wish there was a way that I did not have to deal with lines and lines of script. I guess I can move the functions into a module, but that adds more complexity than I want in my life right now. Is there something that can help?—RR Hello RR,Microsoft Scripting Guy,...

PowerTip: Find the PowerShell ISE Default Options
Nov 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Find the PowerShell ISE Default Options

Doctor Scripto
Doctor Scripto

Summary: Learn how to find the Windows PowerShell ISE default options. How can I find the default options for  the Windows PowerShell ISE object model? Use the ISEOptions object:$psise.Options.DefaultOptions

Ed Wilson Joins the PowerScripting PodCast Tonight
Nov 11, 2015
Post comments count 0
Post likes count 0

Ed Wilson Joins the PowerScripting PodCast Tonight

Doctor Scripto
Doctor Scripto

Summary: Tune-in to the PowerScripting PodCast tonight to hear the Scripting Guy!Ed Wilson, Microsoft Scripting Guy, will be on the PowerScripting PodCast tonight, November 11, 2015. He will talk about his new PowerShell Step-by-Step book, his new job, and lots of other things.Although the show will be recorded, you can tune-in live to chat with Hal, Jon, Ed, and others during the PodCast recording. It will be great fun, informative, and much better than watching an old rerun of Scooby Doo.For more information, see Tonight: Ed Wilson returns to the PowerScripting Podcast!

PowerTip: Find the PowerShell ISE Default Options
Nov 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Find the PowerShell ISE Default Options

Doctor Scripto
Doctor Scripto

Summary: Learn how to find the Windows PowerShell ISE default options.  How can I find the default options for  the Windows PowerShell ISE object model?  Use the ISEOptions object: $psise.Options.DefaultOptions

Automatically Keep Log of PowerShell ISE Commands
Nov 11, 2015
Post comments count 0
Post likes count 0

Automatically Keep Log of PowerShell ISE Commands

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the new transcript command in the Windows PowerShell ISE.  Hey, Scripting Guy! I might be alone in this, but I love using the transcript tool in the Windows PowerShell console. I really wish I could have a transcript in the Windows PowerShell ISE because that is what I use to write scripts. But every time I try to use it, I get a bogus error message that says basically, "Go jump in a lake." How rude. I am just complaining, and I really don’t expect that there is anything you can actually do about this sad state of affairs. Oh, yea...

PowerTip: Change Font Size in PowerShell ISE
Nov 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Change Font Size in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Learn how to change the font size in the Windows PowerShell ISE.  How can I use a Windows PowerShell command to change the font size in my Windows PowerShell ISE?  Use the $psISE object option, and assign a new number for FontSize property, for example: $psISE.Options.FontSize = 12

Use PowerShell to Set Up the ISE
Nov 10, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Set Up the ISE

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to set up the ISE. Hey, Scripting Guy! I am so excited—really excited! I have been selected to speak at a SQL Saturday event about Windows PowerShell. I could not have done it without you. I read your stuff every day, actually twice a day, and I come back to it during the day to help me with things I need to do. I never thought I would be talking about Windows PowerShell.So I have a question, naturally. I would like to set up the ISE in my first script. I know how to run a script to set up my scratch folder, my working fo...

PowerTip: Change PowerShell ISE Foreground Color
Nov 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Change PowerShell ISE Foreground Color

Doctor Scripto
Doctor Scripto

Summary: Programatically change the foreground color in the Windows PowerShell ISE. How can I change the foreground color in the Windows PowerShell ISE? Use $Host.UI.RawUI.ForegroundColor and assign a new color. For example, to change it to cyan, use:$Host.UI.RawUI.ForegroundColor = 'cyan'

PowerTip: Change PowerShell ISE Foreground Color
Nov 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Change PowerShell ISE Foreground Color

Doctor Scripto
Doctor Scripto

Summary: Programatically change the foreground color in the Windows PowerShell ISE.  How can I change the foreground color in the Windows PowerShell ISE?  Use $Host.UI.RawUI.ForegroundColor and assign a new color. For example, to change it to cyan, use: $Host.UI.RawUI.ForegroundColor = 'cyan'

Change Display Output Colors in PowerShell ISE
Nov 9, 2015
Post comments count 0
Post likes count 0

Change Display Output Colors in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about changing the output console colors in the Windows PowerShell ISE. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I like about using the Write-Host cmdlet is that I can change the color of a line that writes to the Windows PowerShell console. But, what if I want to change the entire output console so that the output is really obvious? I can also do that on the fly by using the $host object. As shown here, the $host object returns a number of properties, and it contains a number of other objects: PS C:\Users\mredw> $host Name  ...

Change Display Output Colors in PowerShell ISE
Nov 9, 2015
Post comments count 0
Post likes count 0

Change Display Output Colors in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about changing the output console colors in the Windows PowerShell ISE.Microsoft Scripting Guy, Ed Wilson, is here. One of the things I like about using the Write-Host cmdlet is that I can change the color of a line that writes to the Windows PowerShell console. But, what if I want to change the entire output console so that the output is really obvious? I can also do that on the fly by using the $host object. As shown here, the $host object returns a number of properties, and it contains a number of other objects:PS C:\Users\mredw> $hostName   ...

PowerTip: Display Numeric ASCII Value of Letter
Nov 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Numeric ASCII Value of Letter

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display the numeric ASCII value of a letter. How can I use Windows PowerShell to find the numeric ASCII value associated with a letter? Use [byte] and [char] together. The following example will display the numeric ASCII value of the capital letter A:[byte][char]'A'

Improve Your Writing for Blogs and Technical Articles
Nov 8, 2015
Post comments count 0
Post likes count 0

Improve Your Writing for Blogs and Technical Articles

Doctor Scripto
Doctor Scripto

Summary: The Scripting Editor, Dia Reeves, offers tips to help you improve your writing. Microsoft Scripting Guy, Ed Wilson, is here. Today, I'm enlisting my editor, Dia Reeves, to help you write clear, concise, and consistent blog posts and feature documentation. Take it away Dia... Hello to all of you who have lost your content team (or never had one) and have discovered that you are now writers! Gone are the days where PMs wrote specs, devs wrote code, technical writers documented how to use features, and editors made everything cohesive. Let's hear it...group sighhhh... Additionally, blog writin...

Improve Your Writing for Blogs and Technical Articles
Nov 8, 2015
Post comments count 0
Post likes count 0

Improve Your Writing for Blogs and Technical Articles

Doctor Scripto
Doctor Scripto

Summary: The Scripting Editor, Dia Reeves, offers tips to help you improve your writing.Microsoft Scripting Guy, Ed Wilson, is here. Today, I'm enlisting my editor, Dia Reeves, to help you write clear, concise, and consistent blog posts and feature documentation. Take it away Dia...Hello to all of you who have lost your content team (or never had one) and have discovered that you are now writers! Gone are the days where PMs wrote specs, devs wrote code, technical writers documented how to use features, and editors made everything cohesive.Let's hear it...group sighhhh...Additionally, blog writing has become commo...

PowerTip: Replace Non-Alphabetic Characters in String
Nov 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Replace Non-Alphabetic Characters in String

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to replace non-alphabetic characters in a string. How can I use Windows PowerShell to replace a string that contains non-alphabetic characters            (such as commas and periods)? Use the –Replace operator, and specify a regex pattern '[^a-zA-Z]', for example:$a = 'Never a foot too far, even.'$a -Replace '[^a-zA-Z]',''

PowerTip: Replace Non-Alphabetic Characters in String
Nov 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Replace Non-Alphabetic Characters in String

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to replace non-alphabetic characters in a string.  How can I use Windows PowerShell to replace a string that contains non-alphabetic characters            (such as commas and periods)?  Use the –Replace operator, and specify a regex pattern '[^a-zA-Z]', for example: $a = 'Never a foot too far, even.' $a -Replace '[^a-zA-Z]',''

Weekend Scripter: Exploring Palindrome Sentences with PowerShell
Nov 7, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Exploring Palindrome Sentences with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about identifying palindromes that are more than a single word. Microsoft Scripting Guy, Ed Wilson, is here. One of the coolest things about palindromes is that they can be formed with sentences. It is also what makes them the most subtle. For example, whereas it is pretty obvious that mom, dad, and the name bob are all the same forward and backward, it is not so obvious that the sentence “Never a foot too far, even” is also considered a palindrome. I mean, if I stand on my head, and hold my ear just so, maybe I get it. Clearly, this is a job for Win...

Weekend Scripter: Exploring Palindrome Sentences with PowerShell
Nov 7, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Exploring Palindrome Sentences with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about identifying palindromes that are more than a single word.Microsoft Scripting Guy, Ed Wilson, is here. One of the coolest things about palindromes is that they can be formed with sentences. It is also what makes them the most subtle. For example, whereas it is pretty obvious that mom, dad, and the name bob are all the same forward and backward, it is not so obvious that the sentence “Never a foot too far, even” is also considered a palindrome. I mean, if I stand on my head, and hold my ear just so, maybe I get it. Clearly, this is a job for Windo...

PowerTip: Find if Variable Is Array
Nov 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Find if Variable Is Array

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find if a variable is an array.  How can I use Windows PowerShell to find if a variable contains an array?  Use the –is operator, and test to see if it is a type of [array], for example: $a = 1,2,4,5,6,7 $a -is [array]

PowerTip: Find if Variable Is Array
Nov 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Find if Variable Is Array

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find if a variable is an array.  How can I use Windows PowerShell to find if a variable contains an array?  Use the –is operator, and test to see if it is a type of [array], for example: $a = 1,2,4,5,6,7 $a -is [array]

Use PowerShell to Find Palindromes
Nov 6, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Find Palindromes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to find palindromes. Microsoft Scripting Guy, Ed Wilson, is here. I enjoy playing around with words. I like words that sound similar to each other, such as to, too, and two. I also like words that look alike, and sound alike but have different meanings depending on the context, such as might and might. Of course, there is also mite, which goes back into the previous category of words that sound alike. There are also words that look alike, but are pronounced differently depending on the context (which also, of course, alters the mean...

PowerTip: Use PowerShell to Display ASCII Characters
Nov 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display ASCII Characters

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display ASCII characters.  How can I use Windows PowerShell to quickly display printable ASCII characters when I am not connected            to the Internet?  Use the range operator to create a range of numbers 1 through 128, pipe it to Foreach-Object (% is the alias),            and display the current object and the [char] value on the pipeline, for example: 1..128 | %{"$_ $([char]$_)"}

Generate Random Letters with PowerShell
Nov 5, 2015
Post comments count 0
Post likes count 0

Generate Random Letters with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about generating random letters with Windows PowerShell.  Hey, Scripting Guy! I need to generate a string of random letters. These letters need to be five characters long, and they should be either upper case or lower case. I do not need any numbers or special characters. In fact, my strings should not contain any special characters—only upper case and lower case letters. I have spent several days on this, and it is not working. I am not looking for a random password generator; I have a rather special application for this. Can you help me? —BG &n...

PowerTip: Use PowerShell to Mount ISO Image
Nov 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Mount ISO Image

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to mount ISO images. How can I use Windows PowerShell to mount an ISO image so I can see what it contains? Use the Mount-DiskImage cmdlet and specify a path to the ISO file, for example:Mount-DiskImage -ImagePath C:\Data\en_office_professional_plus_2016_x86_x64_dvd.iso

PowerTip: Use PowerShell to Mount ISO Image
Nov 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Mount ISO Image

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to mount ISO images.  How can I use Windows PowerShell to mount an ISO image so I can see what it contains?  Use the Mount-DiskImage cmdlet and specify a path to the ISO file, for example: Mount-DiskImage -ImagePath C:\Data\en_office_professional_plus_2016_x86_x64_dvd.iso

PowerTip: Use PowerShell to Mount ISO Image
Nov 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Mount ISO Image

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to mount ISO images.  How can I use Windows PowerShell to mount an ISO image so I can see what it contains?  Use the Mount-DiskImage cmdlet and specify a path to the ISO file, for example: Mount-DiskImage -ImagePath C:\Data\en_office_professional_plus_2016_x86_x64_dvd.iso

Reverse Strings with PowerShell
Nov 4, 2015
Post comments count 0
Post likes count 1

Reverse Strings with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to reverse strings. Hey, Scripting Guy! I am working with Windows PowerShell, and I need to reverse a string. I am surprised there is no reverse method in the string class. It seems like a major oversight. Anyway, can you show me how to do this easily?—SS Hello SS,Microsoft Scripting Guy, Ed Wilson, is here. This week is an awesome week. The MVP Summit is going on, and the Scripting Wife is in Bellevue/Redmond/Seattle hanging with thousands of MVPs from around the world. She keeps sending me text messages, like, "Dud...

PowerTip: Display Network Adapter Binding
Nov 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Network Adapter Binding

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display network adapter binding.  How can I use Windows PowerShell to display a list of network adapter binding?  In Windows 10, use the Get-NetworkAdapterBinding cmdlet in Windows PowerShell 5.0.

Long String Running
Nov 3, 2015
Post comments count 0
Post likes count 0

Long String Running

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using a compound string command. Microsoft Scripting Guy, Ed Wilson, is here. The other day, the Scripting Wife and I headed to Nashville for a couple of speaking engagements. We decided to head through Alabama instead of going through Atlanta for a couple of reasons. We have never driven the length of Alabama, so we were looking for a bit of different scenery. Secondly, because we always spend a couple of hours trying to drive through Atlanta and all of the associated communities in the greater Atlanta metropolitan area (hmmmm….Gamma)? Anyway, it wa...

PowerTip: Create Pop-up Message with PowerShell
Nov 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Create Pop-up Message with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily create a pop-up message.  How can I use Windows PowerShell to create a pop-up message?  Use Out-GridView, and pipe your message string to it, for example: "popup message" | Out-GridView -Title "message box"

Creating Pop-ups by Using PowerShell
Nov 2, 2015
Post comments count 0
Post likes count 0

Creating Pop-ups by Using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Guest blogger and PowerShell MVP, Chrissy LeMaire, talks about creating pop-ups with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Welcome today a brand new guest blogger, Chrissy LeMaire. Chrissy is a systems engineer and PowerShell MVP. Always an avid scripter, she attended the Monad session at the Microsoft Professional Developers Conference in Los Angeles in 2005. She has worked and played with PowerShell ever since. You can follow her on Twitter at @cl, and read more about her work with PowerShell on her blog, blog.netnerds.net:\>. Here’s Chrissy… A few weeks ago, I built ...

PowerTip: Reverse an Array with PowerShell
Nov 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Reverse an Array with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to reverse an array with Windows PowerShell.  How can I use Windows PowerShell to reverse the order of an array stored in a variable?  Use the static reverse method from the Array class, for example: $a = @(1,2,3) [array]::reverse($a)

Weekend Scripter: Exploring PowerShell Arrays
Nov 1, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Exploring PowerShell Arrays

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Exploring Windows PowerShell arrays. Microsoft Scripting Guy, Ed Wilson, is here. One of the problems I had with Windows PowerShell when I first learned it was handling arrays. Why? Because they were so easy. Well, they are easy, but they are also a bit confusing. Why? Because Get-Member seems to hide the type, so I may have an array, and it will report string. But that is something I will talk about in a minute. First, let's look at creating an array. Create an array in PowerShell The easiest way to create an array is to simply create a variable and a...

PowerTip: Combine Arrays in PowerShell
Oct 31, 2015
Post comments count 0
Post likes count 0

PowerTip: Combine Arrays in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to combine two arrays in Windows PowerShell.  How can I use Windows PowerShell to combine two arrays stored in two different variables?  Use the + operator, for example:  [array]$a = @('a','b','c')  [array]$b = @(1,2,3)  [array]$c = $a + $b

PowerShell Spotlight: November 2015
Oct 31, 2015
Post comments count 0
Post likes count 0

PowerShell Spotlight: November 2015

Doctor Scripto
Doctor Scripto

Summary: Guest blogger and PowerShell MVP, Teresa Wilson talks about Windows PowerShell community events.Microsoft Scripting Guy, Ed Wilson, is here. It is the last Saturday of October, and that means it is PowerShell Spotlight day with guest blogger, Teresa Wilson.Hello everyone. I hope you are having a scriptastic day! The MVP Summit starts tomorrow. I am looking forward to being in Washington with other MVPs and speaking with the PowerShell team.I know of three events on the horizon to let you know about. The first is on November 11. Ed Wilson will be the guest on the PowerScripting Podcast hosted by MVPs Hal ...

PowerTip: Use PowerShell to Back Up System Databases
Oct 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Back Up System Databases

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to back up system databases.  How can I use Windows PowerShell to dynamically back up all of the system databases on my servers?  Combining provider lookups with the Backup-SqlDatabase cmdlet makes this simple: $instances = @(‘KIRK’,’SPOCK’,’PICARD’,’RIKER’) foreach($instance in $instances){             $dbs = Get-ChildItem SQLSERVER:\SQL\$instance\DEFAULT\Databases -Force | Where-Object {$_.IsSystemObject -eq $true -and $_.Name -ne 'TempDB'}    ...

Use SQL Server PowerShell Provider for Fun and Profit
Oct 30, 2015
Post comments count 0
Post likes count 0

Use SQL Server PowerShell Provider for Fun and Profit

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Mike Fal, talks about leveraging the SQL Server PowerShell provider. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Mike Fal. He blogged yesterday (see Getting Information from the SQL Server Provider with PowerShell), and he continues today... In my previous post, I covered how to gather and view data for our SQL Server components by using the SQL Server provider. Gathering this information is simple, just like looking up files in a directory. Being able to grab collection of SQL Server objects and display their properties exposes things quickly and easily for Po...

PowerTip: Use PowerShell to Find Versions of SQL Server
Oct 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Versions of SQL Server

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find versions of SQL Server. How can I use Windows PowerShell to see all the versions of SQL Server I have installed? Use the provider and a list of instances to look them up as if they were files in a directory:$instances = @(‘KIRK’,’SPOCK’,’PICARD’,’RIKER’)$instances | ForEach-Object {Get-Item “SQLSERVER:\SQL\$_\DEFAULT”} | Select-Object Name,VersionString

PowerTip: Use PowerShell to Find Versions of SQL Server
Oct 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Versions of SQL Server

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find versions of SQL Server.  How can I use Windows PowerShell to see all the versions of SQL Server I have installed?  Use the provider and a list of instances to look them up as if they were files in a directory: $instances = @(‘KIRK’,’SPOCK’,’PICARD’,’RIKER’) $instances | ForEach-Object {Get-Item “SQLSERVER:\SQL\$_\DEFAULT”} | Select-Object Name,VersionString

Getting Information from the SQL Server Provider with PowerShell
Oct 29, 2015
Post comments count 0
Post likes count 0

Getting Information from the SQL Server Provider with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Mike Fal, talks about using the SQL Server provider with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. We have a new guest blogger today. Please welcome Mike Fal. Mike Fal. Mike has over 15 years of experience as a database administrator. He has worked for many different industries, including healthcare, software development, marketing, and manufacturing, and he has experience supporting databases from 1 GB to 5 TB in size. To follow him on Twitter, use @mike_fal. Windows PowerShell providers are an integral part of PowerShell, but their use is so subtle that s...

PowerTip: Use PowerShell to List all Azure Subscription Websites
Oct 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to List all Azure Subscription Websites

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to list all of your Azure subscription websites.  How can I use Windows PowerShell to list all the websites in my Azure subscription that are using the new preview module?  After you have authenticated (Add-AzureRmAccount), run: Get-AzureRmResource -ResourceType Microsoft.Web/sites

Use PowerShell to Scale Azure Websites
Oct 28, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Scale Azure Websites

Doctor Scripto
Doctor Scripto

Summary: Anders Wahlqvist talks about using Windows PowerShell to scale Azure websites. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a guest post from Anders Wahlqvist. Anders is really active on Twitter—as a matter of fact, that is where we met. I saw references to his blog, read it, and found that he was a good writer and had a lot of excellent stuff to say. So I contacted him and asked if he would like to write for the Hey, Scripting Guy! Blog. Here is more about Anders: I work as a consultant at Lumagate focusing on automation and PowerShell. I have a very strong passion about automation a...

PowerTip: Encode String and Execute with PowerShell
Oct 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Encode String and Execute with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to encode a string into base64 and execute it with Windows PowerShell.  How can I encode a string into base64 and then run it via Windows PowerShell?  Use these commands: $string = {(Get-WindowsFeature).Where{$PSItem.Installed}}.ToString() $encodedcommand = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($string)) powershell.exe -EncodedCommand $encodedcommand

Using WinRM on Linux
Oct 27, 2015
Post comments count 0
Post likes count 0

Using WinRM on Linux

Doctor Scripto
Doctor Scripto

Summary: Microsoft MVP, David O’Brien, talks about using the pywinrm module to execute Windows PowerShell from Linux. Microsoft Scripting Guy, Ed Wilson, is here. Today Windows PowerShell MVP, David O’Brien, talks about executing Windows PowerShell on Linux. Hi. I’m David O’Brien, Microsoft MVP for Windows PowerShell, and I was asked by Ed if I wanted to share some of my knowledge on his blog. Sure, cool idea! If you want to read more from me, head over to my personal blog or follow me on Twitter @david_obrien. I recently changed jobs. I am now not only managing and implementing the Window...

PowerTip: Use PowerShell Get-Command to Show Syntax
Oct 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell Get-Command to Show Syntax

Doctor Scripto
Doctor Scripto

Summary: Use the Windows PowerShell Get-Command cmdlet to show syntax of cmdlets.  How can I use Windows PowerShell to explore the allowed syntax for a specific cmdlet?  Use the Get-Command cmdlet, and use the –syntax switch, for example: Get-Command Get-WinEvent -Syntax

Spelunking with Show-Object
Oct 26, 2015
Post comments count 0
Post likes count 0

Spelunking with Show-Object

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Tim Warner, talks about using the Show-Object cmdlet. Microsoft Scripting Guy, Ed Wilson, is here. Today I have another guest post by Tim Warner. By the way, you can meet Tim and other PowerShell enthusiasts at the Nashville PowerShell user group meeting on Wednesday, October 28. I will be there making the presentation. The Scripting Wife will also be in attendance. Also in Nashville this week is Killer Nashville. I will be speaking at that conference too, but not about PowerShell. Hope to see you in Nashville. Take it away Tim... Spelunk [spi-luhngk], verb. To explore caves, especial...

PowerTip: Group PowerShell Cmdlet Count by Version
Oct 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Group PowerShell Cmdlet Count by Version

Doctor Scripto
Doctor Scripto

Summary: Learn how to group Windows PowerShell cmdlet counts by version.  How can I see the version of the modules that contain various cmdlets in Windows PowerShell 5.0?  Use the Get-Command cmdlet to return all of the cmdlets, and then pipe the results to the Group-Object            cmdlet and group and sort by version. gcm | group version | sort version -Descending Note  gcm is an alias for Get-Command, group is an alias for Group-Object, and sort is an alias for Sort-Object.

Weekend Scripter: Test Performance of Event Log Queries—The Video
Oct 25, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Test Performance of Event Log Queries—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about comparing the performance of various Windows PowerShell event log queries.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk about examining the performance of various queries from the event log.Note  For more information about this technique, see Check Performance of Event Log Queries.Here is the video:  [View: is a link to the video if you would like to download it or watch it on another device: Use PowerShell to Measure the Performance of event log queries.I invite you to follow me on Twitter and Facebook. If...

PowerTip: Prompt for Input for PowerShell Script
Oct 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Prompt for Input for PowerShell Script

Doctor Scripto
Doctor Scripto

Summary: Learn how to prompt for input for your Windows PowerShell script.  How can I use Windows PowerShell as an easy way to prompt a user for information for my script?  Use Read-Host, for example: $a = Read-Host -Prompt "enter your input" The users input is stored in the $a variable. Note  Depending on what you are doing, using unchecked user input for your script can be dangerous. It is best to limit user input to prespecified actions. The second best thing is to check the user input to ensure that it meets certain requirements.

Filtering Event Log Entries with PowerShell—The Video
Oct 24, 2015
Post comments count 0
Post likes count 0

Filtering Event Log Entries with PowerShell—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video that explores filtering event log entries with Windows PowerShell.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk about using a filter hash table to filter events from the event log.Note  For more information about this technique, see Filtering Event Log Events with PowerShell.Here is the video:  [View: is a link to the video if you would like to download it or watch it on another device: Using a Filter HashTable to parse event logs by Ed Wilson.Join me tomorrow when I will present a video about comparin...

PowerTip: Record Commands and Output from PowerShell
Oct 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Record Commands and Output from PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily record commands and output from commands in Windows PowerShell.    How can I create a text file all commands and output from the commands that I use in Windows PowerShell?  Use the Start-Transcript cmdlet. To stop the transcript, use Stop-Transcript. Note  In Windows PowerShell 5.0 on Windows 10, Start-Transcript also works inside the Windows PowerShell ISE. In Windows PowerShell 4.0 and earlier it only works in the console.

Parsing Event Log Messages—The Video
Oct 23, 2015
Post comments count 0
Post likes count 0

Parsing Event Log Messages—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video about parsing Windows event log messages.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk about using a cmdlet to parse event log messages.     Note  For more information about this technique, see Easy Parsing of Messages with PowerShell.Here is the video:  [View: is a link to the video from YouTube if you would like to download it or play it offline in a different video player: Parse Event Log Messages with PowerShell by Ed Wilson.Join me tomorrow when I will present a video about using fi...

PowerTip: Measure Performance of PowerShell Command
Oct 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Measure Performance of PowerShell Command

Doctor Scripto
Doctor Scripto

Summary: Measure how long it takes for a Windows PowerShell command to complete.    If I change one command to try to improve the speed of my Windows PowerShell script , how can I see if            that command is faster than the one I changed?  Use the Measure-Command cmdlet. For example, to see if Get-Date or [datetime]::now is faster,            place the command in a script block as shown here: Measure-Command -Expression {get-date} Measure-Command -Expression {[datetime]::now}

Check Performance of Event Log Queries
Oct 22, 2015
Post comments count 0
Post likes count 0

Check Performance of Event Log Queries

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about checking the performance of various event log queries. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about Windows PowerShell is that I can use Windows PowerShell to see how it is doing and how to optimize it. Sometimes the difference between one query and another query can be remarkable. So how can I do performance monitoring for a command? I use the Measure-Command cmdlet. Here is an example of such a command: Measure-Command -Expression {Get-EventLog -LogName application} This command uses the Get-EventLog cmdlet to read the entire...

PowerTip: Query Multiple Event Logs at Once
Oct 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Query Multiple Event Logs at Once

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to query multiple event logs at one time.  How can I use Windows PowerShell to query events that happened and may be in multiple event logs?  Use the Get-WinEvent cmdlet, specify the LogName parameter for both logs, and specify today            for the StartTime, for example: Get-WinEvent @{logname='application','system';starttime=[datetime]::today }

Event Log Queries Using PowerShell
Oct 21, 2015
Post comments count 0
Post likes count 0

Event Log Queries Using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to query event logs. Microsoft Scripting Guy, Ed Wilson, is here. Today I talk a bit more about using Windows PowerShell to make queries from the event log. Although most large enterprises already have an event log monitoring application, at times it is useful to do these types of queries on your own. Keep in mind that this can generate a lot of network traffic and a decent amount of load if you are not cognizant of what is really going on. As I mentioned yesterday, this can be an area of hidden danger, such as the alligator that th...

PowerTip: Find PowerShell Superheroes
Oct 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Superheroes

Doctor Scripto
Doctor Scripto

Summary: Follow the adventures of PowerShell superheroes.  How can I follow the adventures of a couple of PowerShell superheroes as they use PowerShell commands to solve            real world problems?  You want to follow the adventures of BATCHman and Cmdlet (the boy blunder) as they battle Tapeworm, the evil Hextor, and other problems that real-world admins face. You can find the series, written by Windows PowerShell MVP, Sean Kearney, on the Hey, Scripting Guy! Blog: BATCHman Series. To watch the video, see The Adventures of BATCHman and Cmdlet.

Filtering Event Log Events with PowerShell
Oct 20, 2015
Post comments count 0
Post likes count 0

Filtering Event Log Events with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about filtering event log events with the Get-WinEvent cmdlet.  Hey, Scripting Guy! I try to use the Get-WinEvent cmdlet to search event logs, but it is pretty hard to do. Also, I don’t see the nice switches that I had with Get-EventLog, so I don’t see why I should use the other cmdlet and have to pipe everything to Select-Object or Where-Object. —EG  Hello EG, Microsoft Scripting Guy, Ed Wilson, is here. One of the things that you need to realize is that with Windows PowerShell, one should always filter to the left of the pipeline. Th...

PowerTip: Get File System errors on NTFS Volumes with PowerShell
Oct 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Get File System errors on NTFS Volumes with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get file system errors on all NTFS volumes.  How can I use Windows PowerShell to check your NTFS volumes for file system errors?  On Windows 10 with Windows PowerShell 5.0, use the Get-Volume cmdlet to retrieve all volumes and           pipe the output to the Get-VolumeCorruptionCount cmdlet, for example: Get-Volume | Get-VolumeCorruptionCount             Note  This command requires elevation.

Easy Parsing of Messages with PowerShell
Oct 19, 2015
Post comments count 0
Post likes count 0

Easy Parsing of Messages with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about parsing event message strings with Windows PowerShell.  Hey, Scripting Guy! I have seen people using different tools to find stuff in strings in Windows PowerShell, but it always looks complicated. Why is that? I thought Windows PowerShell was supposed to make things easier, but this looks really complicated. Where is the PowerShell advantage in all this? —BR  Hello BR, Microsoft Scripting Guy, Ed Wilson, is here. It is about a week away (actually October 28, 2015) that the Scripting Wife (Windows PowerShell MVP, Teresa Wilson) and I will be...

PowerTip: Produce List of Unique Processes with PowerShell
Oct 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Produce List of Unique Processes with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to filter out duplicate process names.  How can I use Windows PowerShell to easily get a unique list of processes running on my local computer?  Use Get-Process to retrieve the processes and pipe the output to Get-Unique: Get-Process | Get-Unique

Dude It’s a String—The Video
Oct 18, 2015
Post comments count 0
Post likes count 0

Dude It’s a String—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video to talk about working with strings in Windows PowerShell.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk about working with strings—in particular empty or null strings. I talk about the differences between empty, null, and white space in strings and present two static string methods that are always available to deal with the problem.   Note  For more information on these techniques, see Dude, a String Is a String in PowerShell.[View: is a link to the video from YouTube if you would like to download...

PowerTip: Use PowerShell to Display Number of Minutes in a Day
Oct 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display Number of Minutes in a Day

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display the number of minutes in a day.  How can I use Windows PowerShell to easily display how many minutes are in a day?  Create a timespan equal to one day, and then select the total minutes from it: (New-TimeSpan -Days 1).totalminutes

Use PowerShell to Parse Network Trace Logs—The Video
Oct 17, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Parse Network Trace Logs—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video to show how to use Windows PowerShell to parse network trace logs. Microsoft Scripting Guy, Ed Wilson, is here. Today I am presenting a video where I show how to use Windows PowerShell to parse network traces. The steps I show are common commands that will normally be run to set up and collect network tracing. I will talk about the following:    Note  For more information about this technique, see Use PowerShell to Parse Network Trace Logs. Also check out yesterday's video, Use PowerShell to Collect Network Traces. Here is the video:    [View:...

PowerTip: Find Information about Operations Management Suite
Oct 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Information about Operations Management Suite

Doctor Scripto
Doctor Scripto

Summary: Learn how to find information about Microsoft Operations Management Suite.  How can I easily find the latest and coolest blogs and information about Operations Management Suite?  On Twitter, create a filter for #MSOMS.

Use PowerShell to Collect Network Traces—The Video
Oct 16, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Collect Network Traces—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video that shows how to use Windows PowerShell to collect network traces.Microsoft Scripting Guy, Ed Wilson, is here. Today I'm present a video where I show how to use Windows PowerShell to collect network traces. The steps I show are common commands that will normally be run to set up and collect network tracing. I talk about the following:    Note  For more information about this technique, see Use PowerShell to Parse Network Trace Logs.Here is the video:  [View: is a link to the video from YouTube if you would like to downlo...

Now Available! Windows PowerShell Step by Step, Third Edition
Oct 15, 2015
Post comments count 0
Post likes count 0

Now Available! Windows PowerShell Step by Step, Third Edition

Doctor Scripto
Doctor Scripto

We’re pleased to announce the availability of Windows PowerShell Step by Step, Third Edition (ISBN 9780735675117), by Ed Wilson. Purchase from these online retailers: Microsoft Press Store Amazon.com Barnes & Noble Independent booksellers – Shop local Your hands-on guide to Windows PowerShell scripting fundamentals Expand your expertise—and teach yourself the fundamentals of Windows PowerShell scripting, including features available in Windows PowerShell 5.0. If you are an IT professional, power user, or consultant, you’ll get the guidance, exercises, and code you need to master core tec...

PowerTip: Get Unique Numbers from Array
Oct 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Unique Numbers from Array

Doctor Scripto
Doctor Scripto

Summary: Learn how to get unique numbers from an array.  How can I use Windows PowerShell to return only the numbers that are unique in an array?  Sort the array of numbers, then pipe the output to the Get-Unique cmdlet, for example: $a = 1,2,7,6,4,3,3,2,9 $a | sort | Get-Unique Note  Sort is an alias for the Sort-Object cmdlet.

Use PowerShell to Parse Network Trace Logs
Oct 15, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Parse Network Trace Logs

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to analyze packet trace logs. Microsoft Scripting Guy, Ed Wilson, is here. Today I want to finish my discussion about analyzing a network trace log that was captured by using the cmdlets from the NetEventPacketCapture module.    Note  To start my network trace, I need to use the following four commands: Remove-NetEventSession $session = New-NetEventSession -Name "Session1" Add-NetEventProvider -Name "Microsoft-Windows-TCPIP" -SessionName "Session1” Start-NetEventSession -Name "...

PowerTip: Sort an Array of Numbers with PowerShell
Oct 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Sort an Array of Numbers with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to sort an array of numbers with Windows PowerShell.  How can I use Windows PowerShell to easily sort an array of numbers?  Pipe the array to the Sort-Object (sort is an alias) cmdlet, for example: $a = 1,2,7,6,4,3,3,2,9 $a | sort

Packet Sniffing with PowerShell: Looking at Messages
Oct 14, 2015
Post comments count 0
Post likes count 0

Packet Sniffing with PowerShell: Looking at Messages

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy Ed Wilson talks about looking at the message field in a packet log with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Yesterday I begin analyzing a packet trace log. Note  For more information about setting up and making a packet trace, see Packet Sniffing with PowerShell: Getting Started. For more information about doing basic analytics, see Use PowerShell to Parse Network Log. You may be surprised if you have rebooted your computer, logged off and back on, and opened and closed Windows PowerShell. If you go to create a new net event session, and you call ...

Use PowerShell to Parse Network Log
Oct 13, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Parse Network Log

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to parse a network trace log.Microsoft Scripting Guy, Ed Wilson, is here. Today I want to talk a little bit about using Windows PowerShell to parse a network trace log. In yesterday’s blog post, Packet Sniffing with PowerShell: Getting Started, I talked using Windows PowerShell to do a network trace.Yesterday, I created a network trace log. I can use that log, or I can create a new log.            Note  These commands require that Windows PowerShell is elevated.When I...

PowerTip: Send Message to Information Stream in PowerShell
Oct 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Send Message to Information Stream in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to send information for a command to a separate information stream.  How can I use Windows PowerShell to send information to a user via a separate information stream,            without changing the default information preference variable?  In Windows PowerShell 5.0, use the new Write-Information cmdlet, for example: gps ; Write-Information "process information" -InformationAction continue Note  gps is an alias for the Get-Process cmdlet.

PowerTip: Display Every PowerShell Example in Help
Oct 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Every PowerShell Example in Help

Doctor Scripto
Doctor Scripto

Summary: Display every Windows PowerShell example that Help contains.  How can I use Windows PowerShell to display every Help example that Windows PowerShell contains?  Use Get-Command to retrieve all of the cmdlet names, pipe the output to Foreach-Object,            and call Get-Help with the –Example switch, for example: gcm | % {get-help $_.name -ex} Note  GCM is an alias for Get-Command and % is an alias for Foreach-Object.

Packet Sniffing with PowerShell: Getting Started
Oct 12, 2015
Post comments count 1
Post likes count 0

Packet Sniffing with PowerShell: Getting Started

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about getting started with packet sniffing in Windows PowerShell.Microsoft Scripting Guy, Ed Wilson, is here. One of the way cool things that happened with Windows 8.1 and Windows Server 2012 R2 was the ability to do network traces with Windows PowerShell. I have found network tracing extremely useful and helpful in troubleshooting and diagnostics ever since I wrote my book, Network Monitoring and Analysis: A Protocol Approach to Troubleshooting.In the past, I have used batch files, automated the NetMon API, and done all kinds of crazy things to tr...

PowerTip: Find Windows Capabilities with PowerShell
Oct 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Windows Capabilities with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Find Windows capabilities with Windows PowerShell on Windows 10.  How can I use Windows PowerShell 5.0 on Windows 10 to determine capabilities such as handwriting,            optical character recognition (OCR), speech, and text-to-speech on my installation?  Use the Get-WindowsCapability cmdlet, specify the -Online parameter, and filter for a state of Installed,            for example: Get-WindowsCapability -Online | where state -eq 'Installed'         &nb...

Playing with JSON and PowerShell—The Video
Oct 11, 2015
Post comments count 0
Post likes count 0

Playing with JSON and PowerShell—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video where he describes converting JSON data with Windows PowerShell.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk about using the ConvertFrom-JSON cmdlet to parse information returned via Invoke-WebRequest. I am using Windows PowerShell 5.0 on Windows 10 to illustrate this technique. It is powerful and useful, and it makes for a better experience than having to parse XML.            Note  For more information about this technique, see Playing with JSON and Power...

PowerTip: Find Latest Events in Windows Event Log
Oct 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Latest Events in Windows Event Log

Doctor Scripto
Doctor Scripto

Summary: Learn how to quickly find the latest events in a Windows event log.  How can I use Windows PowerShell to look in the Application log to see the latest events?  Use the Get-Eventlog cmdlet, specify the log name, and select newest events, for example: Get-EventLog application -Newest 5

Troubleshooting WinRM—The Video Part 2
Oct 10, 2015
Post comments count 0
Post likes count 0

Troubleshooting WinRM—The Video Part 2

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video about troubleshooting WinRM (part 2). Microsoft Scripting Guy, Ed Wilson, is here. Today I present part two of my troubleshooting WinRM video. In this video, I talk about five basic commands that are used in troubleshooting WinRM. Note  For more information about these commands see this Hey, Scripting Guy Blog post: Troubleshooting WinRM with PowerShell—Part 2. I hope you enjoy this video. [View: Here is a link to the video from YouTube if you would like to download it or play it offline in a different video player (like stream it on your Xbox...

PowerTip: Use PowerShell to Get Windows Home Location
Oct 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Windows Home Location

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get the Windows home location setting.  How can I get the Windows GeoID home location setting for the current user account with            Windows PowerShell 5.0 on Windows 10?  Use the Get-WinHomeLocation cmdlet.

Troubleshoot WinRM—The Video Part 1
Oct 9, 2015
Post comments count 0
Post likes count 0

Troubleshoot WinRM—The Video Part 1

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video about troubleshooting WinRM (part 1). Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk a bit about troubleshooting WinRM. First I talk about looking at the WinRM logs, and then I talk about checking specific things such as:    Note  For more information about this technique, refer to: Here is the video... [View: Here is a link to the video from YouTube if you would like to download it or play it offline in a different video player (like stream it on your Xbox One like I do): Troubleshooting WinRM Part 1 ...

PowerTip: Find Win32 Type Data in PowerShell
Oct 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Win32 Type Data in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Win32 WMI classes in Windows PowerShell that have type data.  How can I easily find which WMI classes in Windows PowerShell have their own type data?  Use the Get-TypeData cmdlet and filter for types that contain Win32, for example: Get-TypeData -TypeName *win32*

Playing with JSON and PowerShell
Oct 8, 2015
Post comments count 0
Post likes count 0

Playing with JSON and PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about playing with JSON and Windows PowerShell 5.0. Microsoft Scripting Guy, Ed Wilson, is here. The Scripting Wife has an updated shopping list. It includes a Microsoft Band 2 and a Surface Pro 4. The launch was a mouthwatering event and really well done. One of the cool cmdlets in Windows PowerShell 5.0 on Windows 10 is the ConvertFrom-JSON cmdlet. One reason it is cool is that it will convert a Java Script Object Notation (JSON) string into a custom Windows PowerShell object. This is a cool way to interact with web services, and it can save...

PowerTip: Concatenate String Array with PowerShell
Oct 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Concatenate String Array with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to concatenate elements of a array.  How can I use Windows PowerShell to concatenate the elements of a string array?  Use the static Concat method from the String class, for example: $a = "string a" $b = "string b" $arr = @($a,$b) [string]::Concat($arr)

Dude, a String Is a String in PowerShell
Oct 7, 2015
Post comments count 0
Post likes count 0

Dude, a String Is a String in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using string methods to determine null or empty in Windows PowerShell.  Hey, Scripting Guy! I have a problem with a script. It is used to write data to another application, but sometimes the variables in it are empty. I have tried to detect this by checking to see if the variable is equal to $null, but this does not work very well. I need a different way to do this. Can you help? —JB  Hello JB, Microsoft Scripting Guy, Ed Wilson, is here. When I was looking out the window this morning, I saw a squirrel drop from a tree, look up, and then bun...

PowerTip: Enable PowerShell Remoting
Oct 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Enable PowerShell Remoting

Doctor Scripto
Doctor Scripto

Summary: Learn how to enable Windows PowerShell remoting.  How can I turn on Windows PowerShell remoting on my workstation so it will run remote commands?  Use the Enable-PSRemoting cmdlet.

Troubleshooting WinRM with PowerShell—Part 2
Oct 6, 2015
Post comments count 0
Post likes count 0

Troubleshooting WinRM with PowerShell—Part 2

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about troubleshooting WinRM.  Hey, Scripting Guy! So I thought that Windows PowerShell remoting was supposed to just work. Well, it doesn't. I am confused, and don’t even know where to begin. I am pretty sure that it should be enabled, but it is not working. Can you help? —EG  Hello EG, Microsoft Scripting Guy, Ed Wilson, is here. This morning it is rather foggy outside. To be honest, I am not really certain if it is fog or low lying clouds. The weather stations are talking about a hurricane, but we are in central Florida, so we will no...

PowerTip: Produce List of Disabled Windows Features
Oct 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Produce List of Disabled Windows Features

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to produce a list of disabled Windows features.  How can I use Windows PowerShell to see what Windows features are disabled in my installation? Open an elevated Windows PowerShell console, use the Get-WindowsOptionalFeatures cmdlet, and specify            that you want to run the command online. You may also want to filter the list by disabled state and sort the list,            for example: Get-WindowsOptionalFeature -Online | ? state -eq 'disabled' | select featurename | sort -Descending Note&nbs...

Troubleshoot WinRM with PowerShell—Part 1
Oct 5, 2015
Post comments count 0
Post likes count 0

Troubleshoot WinRM with PowerShell—Part 1

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to look at WinRM logs.  Hey, Scripting Guy! I am having problems with WinRM. When I use the Get-CimInstance cmdlet, it fails. When I specify the –DCOM protocol for Get-CimInstance, it works. I suspect I have a WinRM problem. How can I go about troubleshooting it? —TB  Hello TB, Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about Windows, regardless of the version, is that there are some awesome diagnostics and operational logs. I am not talking about the traditional event logs that have b...

PowerTip: Use PowerShell to Find System Uptime
Oct 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find System Uptime

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find your system uptime.  How can I use Windows PowerShell to easily find how long my computer has been running?  Use the Get-Date cmdlet to return the current date and time, and then subtract the value            of the LastBootUpTime property that comes from the Win32_OperatingSystem, for example: (get-date) - (gcim Win32_OperatingSystem).LastBootUpTime Note  GCIM is an alias for Get-CimInstance.

Weekend Scripter: That’s Not Very PowerShell-Like
Oct 4, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: That’s Not Very PowerShell-Like

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about what is Windows PowerShell-like scripting.Microsoft Scripting Guy, Ed Wilson, is here. Before Internet streaming, before Nabster, before CD-ROMs, before cassette tapes, and before 8-track tapes, there were things called records. Now it seems that all technology related to music (unless you are talking about live acoustic performances) are subject to some kind of something that will cause them to fail.With records, it was a scratches. Not the invisible sorts of scratches that cause DVDs to fail—no, I mean serious scratches that came from someone bumpin...

PowerTip: Create Sortable GUI List of Files with PowerShell
Oct 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Create Sortable GUI List of Files with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display a filterable GUI list of files.  How can I use Windows PowerShell to filter a list of files using a graphical user interface?  Use the Get-ChildItem cmdlet to obtain a directory list, select all of the properties and pipe the output            to the Out-GridView cmdlet, for example: dir c:\fso | select * | ogv Note  Dir is an alias for Get-ChildItem and ogv is an alias for Out-GridView.

Weekend Scripter: Search and Filter Directory Lists with PowerShell
Oct 3, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Search and Filter Directory Lists with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to sort, search, and to filter through a directory list. Microsoft Scripting Guy, Ed Wilson, is here. One of my friends on Facebook posted a picture of a bunch of hardwood trees all decked out in fall colors. It was rather pretty. That is the down side to living in central Florida—I mean, I have never seen a palm tree in fall colors. Of course, it is 82 degrees Fahrenheit (28 degrees Celsius), so I guess we don’t really have fall. But the humidity is dropping (down to 55% instead of the usual 75%), so it feels cool outsi...

PowerTip: Use Non-Approved Cmdlet or App within PowerShell Workflow
Oct 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Non-Approved Cmdlet or App within PowerShell Workflow

Doctor Scripto
Doctor Scripto

Summary: Learn how to use a basic inline script in Windows PowerShell workflows.  I’m trying to convert a Windows PowerShell script to a workflow, but I keep running into an error that suggests            the cmdlet cannot be used in a workflow. How can I get around this?  Wrap that section of the workflow as an inline script, and recapture your variables with the Using keyword,            for example: Inlinescript             {        &nbs...

Use PowerShell to Create Windows To Go Keys—Part 5
Oct 2, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Windows To Go Keys—Part 5

Doctor Scripto
Doctor Scripto

Summary: Use a basic Windows PowerShell workflow to create multiple devices. Hey, Scripting Guy! I was wondering if there is an efficient way to use Windows PowerShell to create multiple Windows To Go keys at the same time.—TM Hello TM,Honorary Scripting Guy, Sean Kearney, is here today. I am going to wind up my week of posts by playing with that very idea.   Note  This is a five-part series that includes the following posts: Today I'm going to implement a basic Windows PowerShell workflow to image multiple Windows To Go keys from the same image. The process is actually ve...

PowerTip: Back up Drivers with PowerShell
Oct 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Back up Drivers with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Export-WindowsDriver cmdlet to back up all of your Windows drivers elsewhere.  How can I use Windows PowerShell in Windows 10 to get a copy of the current drivers in my Windows            operating system when my computer is a clone system?  Use the Export-WindowsDriver cmdlet to back up all of your drivers to a folder or a USB device, for example: Export-WindowsDriver -Online -Destination I:\

Use PowerShell to Create Windows To Go Keys—Part 4
Oct 1, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Windows To Go Keys—Part 4

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to inject drivers and populate the data for Unattend.xml. Hey, Scripting Guy! I have a Windows To Go key. Is there a script to automatically give the key a proper workstation name or possibly even add some additional drivers?—TG Hello TG,Honorary Scripting Guy, Sean Kearney, is here, and the magical answer to your question, which is, "YES!"    Note  This is a five-part series that includes the following posts: Windows To Go isn’t really all that special. The ability to add drivers though DISM, automatically name a workstation, or ...

PowerTip: Launch Console Command Embedded in Powershell Variable
Sep 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Launch Console Command Embedded in Powershell Variable

Doctor Scripto
Doctor Scripto

Summary: Use a variable to launch a Windows PowerShell cmdlet and maintain the value of $LastExitCode.  How can I use Windows PowerShell to launch a variable that contains the path to a console application            while retaining the error code?  Use the & character before the content in question. This example launches Tree.com in System32            by passing in the Environment variable for Windows: & "$ENV:Windir\system32\tree.com"   

Use PowerShell to Create Windows To Go Keys—Part 3
Sep 30, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Windows To Go Keys—Part 3

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to apply an image to a Windows To Go key and make it bootable. Hey, Scripting Guy! Now that I have a Windows To Go key partitioned and formatted for use, how do I apply the operating system image to it?—MR Hello MR,Honorary Scripting Guy, Sean Kearney, is here to continue forth and show you the next step in creating a Windows To Go key.   Note  This is a five-part series that includes the following posts: To use Windows To Go, we must have one of the following versions of the Windows operating system: The source of the image can be a gold...

PowerTip: Use PowerShell to Find Where Drive Letter is Stored
Sep 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Where Drive Letter is Stored

Doctor Scripto
Doctor Scripto

Summary: Use the Get-Partition and Get-Disk cmdlets to identify data storage locations.  How can I use Windows PowerShell to easily figure out which disk a particular drive letter is on?  Use Get-Partition with the drive letter and pipe the results to Get-Disk, for example: Get-Partition –DriveLetter Z | Get-Disk

Use PowerShell to Create Windows To Go Keys—Part 2
Sep 29, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Windows To Go Keys—Part 2

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to partition a Windows To Go device. Hey, Scripting Guy! Am I able to use Windows PowerShell to set up the necessary partitions to prepare a Window To Go key?—LL Hello LL,Honorary Scripting Guy, Sean Kearney, is here. I'm continuing with my little chat about setting up Windows To Go keys through Windows PowerShell.   Note  This is a five-part series that includes the following posts: Yesterday, I talked about how to use the Get-Disk cmdlet to identify keys. Today I'm going to use that information to prepare the necessary partition structure....

PowerTip: Use PowerShell to Identify Bootable Disks
Sep 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Identify Bootable Disks

Doctor Scripto
Doctor Scripto

Summary: Use the Get-Disk cmdlet to identify all bootable devices that are attached.  How can I use Windows PowerShell to see which USB devices are set to be bootable on my workstation?  Use the Get-Disk cmdlet and filter on the BootFromDisk and BusType properties, for example: Get-Disk | Where { $_.BusType -eq 'USB' -and $_.BootFromDisk -eq $TRUE }   

Use PowerShell to Create Windows To Go Keys—Part 1
Sep 28, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Windows To Go Keys—Part 1

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to identify Windows To Go devices.  Hey, Scripting Guy! I’ve heard a lot of talk about Windows To Go amongst the IT pros at our local user group. I was wondering how I would go about trying to create them with Windows PowerShell? —DM  Hello DM, Honorary Scripting Guy, Sean Kearney, is here today, and I’m happy to share that knowledge with you.       Note  This is a five-part series that includes the following posts: Before I start on the Windows PowerShell part, I’ll touch quickly on what Windows To Go is. It&rs...

PowerTip: Use PowerShell to Find Approved Verb
Sep 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Approved Verb

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find an approved verb.  I want to write a new function that will connect a young Jedi Knight to the force by using the noun TheForce and            the verb Use. How can I use Windows PowerShell to find if Use is an approved verb?  Use the Get-Verb cmdlet and pass it to the verb: Get-Verb Use

Weekend Scripter: Parsing the DISM Log with PowerShell
Sep 27, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Parsing the DISM Log with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about parsing the DISM log with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I like to do on weekends is mess around. So I was intrigued when I found a DISM command that would supposedly export file associations (see DISM Default Application Association Servicing Command-Line Options). I thought, "Cool." Unfortunately, I was not able to find a “PowerShell way" of doing it, but then, hey, the cool thing about a command-line environment is that it makes command-line tools really easy-to-use. So I gave it a ...

PowerTip: Finding PowerShell User Groups
Sep 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Finding PowerShell User Groups

Doctor Scripto
Doctor Scripto

Summary: Learn how to find out about Windows PowerShell user groups.  Where can I find out about local or virtual user groups?  Check out these sites to find information about when and where user groups are meeting,            in addition to the topics of conversation:

September PowerShell Spotlight
Sep 26, 2015
Post comments count 0
Post likes count 0

September PowerShell Spotlight

Doctor Scripto
Doctor Scripto

Summary: Windows PowerShell MVP, Teresa Wilson, talks about events happening in the world of PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. It is the last Saturday of the month again, and the day that the Scripting Wife, Microsoft PowerShell MVP, Teresa Wilson, takes over the keyboard to share upcoming community events and news. I like to call it PowerShell Spotlight. P.S. Speaking of spotlight...I may get in trouble for this, but oh well...HAPPY BIRTHDAY to you, Teresa! Greetings scripters, It appears that there is a lot going on in the next few weeks. First off, on Oct 3-4, there is the Silicon Valle...

PowerTip: Use PowerShell to Get Events for Specific Day
Sep 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Events for Specific Day

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get event log events that occur on a specific day.  How can I use Windows PowerShell to get application event log events that occur only on Sept. 24, 2015?  Use the Get-EventLog cmdlet and specify the log name and the before and the after dates, for example: Get-EventLog -LogName application -After "9/24/15" -Before "9/25/15"

A Tale of Two PowerShell Cmdlets
Sep 25, 2015
Post comments count 0
Post likes count 0

A Tale of Two PowerShell Cmdlets

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to explore classic event logs. Microsoft Scripting Guy, Ed Wilson, is here. When you get to version five of anything, you already begin to see signs on strain and pain. I mean, take Windows NT 5.0, for example. Oh yeah. That one was delayed for about five years, and it eventually became Windows 2000. Part of the reason is that no matter how good the original version or vision was, things change. Priorities change. And more often than not, computers and technology change. Often, it is easier to create a new tool, than to retrofit an ...

PowerTip: Get Specific Service Information with PowerShell
Sep 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Specific Service Information with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to get specific service information.  How can I use Windows PowerShell to find information about services, if I do not want to include any service             that has a name that begins with the letter “s”?  Use the Exclude parameter from the Get-Service cmdlet, for example: gsv -Exclude s* Note  Gsv is an alias for the Get-Service cmdlet.

The Death of PowerShell Scripting
Sep 24, 2015
Post comments count 0
Post likes count 0

The Death of PowerShell Scripting

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the reduced need to use Windows PowerShell scripting. Microsoft Scripting Guy, Ed Wilson, is here. If you follow me on Twitter or Facebook, you already know that my new book, Windows PowerShell Step by Step, third edition, is on its way to the printers. I am not going to talk about that today—but it dawned on me as I was completing the final tasks for this book, that I did not talk about as much scripting in the book as I did, for example, in the Windows PowerShell 1.0 Step by Step book. This is not because I don’t like to script. In fact, ...

PowerTip: Get Week of Year with PowerShell
Sep 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Week of Year with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to get the week of the year.  How can I use Windows PowerShell to find how many weeks are left in the current year—without doing lot of math or            calendaring stuff?  Use the Get-Date cmdlet but specify a –uformat of %V: Get-Date -UFormat %V Note  Please remember that UFormat strings are case sensitive, so it is capital V, not lowercase v.

Extending Objects with PowerShell: Week of the Year
Sep 23, 2015
Post comments count 0
Post likes count 0

Extending Objects with PowerShell: Week of the Year

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson talks about adding members to an object with Windows PowerShell to get the week of the year.Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about Windows PowerShell is that it is configurable. Not merely configurable, but amazingly flexible. For example, when I look at a DateTime object, I see the following:PS C:\Users\mredw> Get-Date | fl *DisplayHint : DateTimeDateTime    : Tuesday, September 22, 2015 11:48:25 AMDate        : 9/22/2015 12:00:00 AMDay         : 22DayOfWeek &nbs...

PowerTip: Find Number of Hours in Number of Days
Sep 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Number of Hours in Number of Days

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the number of hours in a number of days.  How can I use Windows PowerShell to easily figure out how many hours are in 30 days without            doing any multiplication?  Use New-TimeSpan to create a timespan object for 30 days. The output will tell the number of hours,            minutes, and seconds in the timespan. Here is an example: New-TimeSpan -Days 30 To return only the number of hours, retrieve the TotalHours property: PS C:\> (New-TimeSpan -Days 30).totalhours 720

Break Text File into Chunks with PowerShell
Sep 22, 2015
Post comments count 0
Post likes count 0

Break Text File into Chunks with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about breaking the contents of a text file into chunks with Windows PowerShell.  Hey, Scripting Guy! The other day, you tweeted Get First 140 Characters from String with PowerShell. That is fine, but what about the rest of the text? I mean, if I want to break a text file into lines of 140 characters, how do I go about it? Can you provide a concrete example please? —BG  Hello BG, Microsoft Scripting Guy, Ed Wilson, is here. The markets are mixed, there is a chance of afternoon thunderstorms, and there is a lizard scampering about on the outside pat...

PowerTip: Use PowerShell to Determine Host
Sep 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Determine Host

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find your PowerShell host.  How can I use Windows PowerShell to determine what PowerShell host is being used?  Use the Get-Host cmdlet. To get only the name of the host, use the following syntax: (Get-Host).name

Talk Like a Pirate—The Video
Sep 21, 2015
Post comments count 0
Post likes count 0

Talk Like a Pirate—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks a bit about the script he wrote to translate pirate speech by using Invoke-WebRequest.Microsoft Scripting Guy, Ed Wilson, is here. Today I present a video where I talk a bit about my script to submit data to a webpage and receive information back from that page. These sorts of web projects seem to take a lot of time—in fact, many times it seems like they take more time than they are worth.This is because each webpage can be different, and because they can change on a whim. It is much better to have a structured API or a web service to perform these types of...

PowerTip: Use PowerShell to Find Title of Foreground Word Document
Sep 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Title of Foreground Word Document

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the title of the foreground Word document.  How can I use Windows PowerShell to find the title of the Word document that is currently in the foreground when            I have several documents open?  The Get-Process cmdlet with the MainWindowTitle property will list the title of the Word document.            This example presents the main window title and the start time of the application: Get-Process winword | select starttime, MainWindowTitle

Weekend Scripter: A Way Cool DevOps Conference in London
Sep 20, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: A Way Cool DevOps Conference in London

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about a way cool DevOps conference in London.Microsoft Scripting Guy, Ed Wilson, is here. Sometimes, things are really crazy, and at other times, things are just normally crazy. One of the cool things about being the Scripting Guy is that I hear from people all over the world, and as time progresses, we become friends around a shared interest in automation.So, I received a way cool invitation the other day via scripter@microsoft.com to attend a DevOps conference in London. Unfortunately, I am not flying right now, but I talked to the organizer, and we decided tha...

PowerTip: Display Current Time with PowerShell
Sep 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Current Time with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to display the current time by using Windows PowerShell.  How can I  use Windows PowerShell to display the time with the hour, minute, and seconds?  Use the ToString method from the Get-Date cmdlet, and use the long time pattern format            string (see Standard Date and Time Format Strings) to overload the method, for example: (get-date).ToString('T')

Weekend Scripter: PowerShell for "Talk Like a Pirate" Day
Sep 19, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell for "Talk Like a Pirate" Day

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to translate for International Talk Like A Pirate day. Ahoy mates! Microsoft Scripting Guy, Ed Wilson, is here. It is one of my favorite holidays of the year—probably my favorite holiday. Yep, it is International Talk Like a Pirate day today. The Scripting Wife and I are heading to the coast for some authentic pirate reenactments and a fun day of culture and education. Arrrrrr... Here is a picture of the Scripting Wife trying out her pirate speak with a couple of nautical looking individuals. Well, me hearties...If you would ...

PowerTip: Find Effective AppLocker Policy with PowerShell
Sep 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Effective AppLocker Policy with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the effective AppLocker policy.  How can I use Windows PowerShell to find the effective AppLocker policy after considering domain policies            and local policies?  Open Windows PowerShell with Admin rights, and use the Get-AppLockerPolicy cmdlet with the             –Effective switch: Get-AppLockerPolicy -Effective

How to Use Try/Catch/Finally for Non-Terminating Errors
Sep 18, 2015
Post comments count 0
Post likes count 0

How to Use Try/Catch/Finally for Non-Terminating Errors

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell and Try/Catch/Finally for non-terminating errors.Microsoft Scripting Guy, Ed Wilson, is here. Today I want to present a video about using Windows PowerShell Try/Catch/Finally with non-terminating errors—that is, Windows PowerShell can progress past the errors when they occur to the next line of code.Note  For more information, refer to Understanding Non-Terminating Errors in PowerShell.Here is the video: [View: is a link to the video from YouTube if you would like to download it or play it offline in a different vide...

PowerTip: Find Operating System Version and Installation Date with PowerShell
Sep 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Operating System Version and Installation Date with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the operating system version and installation date.  How can I use Windows PowerShell to find the version of my Windows operating system, its installation date,            and the operating system architecture?  Use the Get-CimInstance cmdlet (GCIM is an alias) and query the Win32_OperatingSystem WMI class,            for example: gcim Win32_OperatingSystem | select Version, InstallDate, OSArchitecture

Understanding Two Types of PowerShell Errors—The Video
Sep 17, 2015
Post comments count 0
Post likes count 0

Understanding Two Types of PowerShell Errors—The Video

Doctor Scripto
Doctor Scripto

Summary: In this video, Ed Wilson, Microsoft Scripting Guy, talks about two types of Windows PowerShell errors.Microsoft Scripting Guy, Ed Wilson, is here. Today I want to present a video I made about structured error handling, in specific, about terminating errors.Note  For more information, refer to Error Handling: Two Types of Errors.Here is the video:[View: is a link to the video from YouTube if you would like to download it or play it offline in a different video player: Intro To Error Handling in PowerShell by Ed Wilson.I invite you to follow me on Twitter and Facebook. If you have any questions, ...

PowerTip: Check What PowerShell Does When Error Occurs
Sep 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Check What PowerShell Does When Error Occurs

Doctor Scripto
Doctor Scripto

Summary: See what Windows PowerShell will do when an error occurs.  How can I check the setting so I will know what Windows PowerShell will do if an error occurs?  Look for the value of the $ErrorActionPreference. By default, it is set to Continue, which means it will            attempt to execute the next command. Other values are Stop, Inquire, and Ignore.            Here is an example of the command: PS C:\> $ErrorActionPreferenceContinue

Understanding Non-Terminating Errors in PowerShell
Sep 16, 2015
Post comments count 0
Post likes count 2

Understanding Non-Terminating Errors in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about understanding non-terminating errors in Windows PowerShell.  Hey, Scripting Guy! Yesterday in Error Handling: Two Types of Errors, you were talking about terminating errors and how you can use Try/Catch/Finally with those, but you did not really say what a non-terminating error is. Can you talk about that for a little bit please? —SK  Hello SK, Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sitting here sipping a cup of English Breakfast tea with a cinnamon stick in it, and munching on a piece of baklava. You see, we just cel...

PowerTip: Get First 140 Characters from String with PowerShell
Sep 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Get First 140 Characters from String with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to retrieve the first 140 characters from a string.  How can I use Windows PowerShell to retrieve the first 140 characters from a string?  Use the SubString method from a string. Specify the starting point (in this case 0) and the            number of characters to retrieve (in this case 140). The following example assumes that $a            contains a string with more than 140 characters: $a.SubString(0,140)

Error Handling: Two Types of Errors
Sep 15, 2015
Post comments count 0
Post likes count 0

Error Handling: Two Types of Errors

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about error handling and two types of errors.  Hey, Scripting Guy! I really don’t get it. Everyone tells me I need to use Try/Catch/Finally to catch errors, but it simply won’t work. I am not sure if there is a bug in Windows PowerShell, but I wish you guys would fix it because it doesn't work. Can you help me? —SH  Hello SH, Microsoft Scripting Guy, Ed Wilson, is here. It is becoming fall around here in central Florida. In fact, last night it got down to about 69 degrees Fahrenheit. I mean, it was cold. It is something to look fo...

PowerTip: Find PowerShell Exported Types
Sep 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Exported Types

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Windows PowerShell exported types.  How can I easily look at runspace exported types in Windows PowerShell?  Call the Assembly property from the [psobject] type accelerator, and then call the GetExportedTypes() method,            for example: [psobject].Assembly.GetExportedTypes()

Backwards Compatibility in PowerShell
Sep 14, 2015
Post comments count 0
Post likes count 0

Backwards Compatibility in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about backwards compatibility in Windows PowerShell. Hey, Scripting Guy! I wrote a script on a system with Windows PowerShell 4.0 installed. Is there an easy way to find out the earliest version of Windows PowerShell on which it will run?—DH Hello DH,Microsoft Scripting Guy, Ed Wilson, is here. This question did not come in via the scripter@microsoft.com email alias. Instead, it came via Twitter to @ScriptingGuys. It doesn’t matter if the question is about Windows PowerShell 5.0, 4.0, 3.0, or even Windows PowerShell 2.0. The answer is t...

PowerTip: Use PowerShell to Create New Virtual Disk
Sep 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create New Virtual Disk

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to create a new virtual disk.  How can I use Windows PowerShell to create a new virtual disk?  Use the New-VirtualDisk cmdlet, for example: New-VirtualDisk -StoragePoolFriendlyName Data -FriendlyName MyData -Size 10GB

Weekend Scripter: PowerShell 5 Class Inheritance and Overrides—The Video
Sep 13, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell 5 Class Inheritance and Overrides—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video where he talks about class inheritance and property overrides in Windows PowerShell 5.0.Microsoft Scripting Guy, Ed Wilson, is here. The air show in Tampa was awesome. Today the Scripting Wife and I decided to head to the Magic Kingdom at Disney World. It is a lot of fun, and besides that, it is a beautiful weekend to have a birthday. Before we head out, however, I want to share a video I made where I talk a little bit about class inheritance in Windows PowerShell 5.0.Note  For more information about class inheritance and property overrides i...

PowerTip: Use PowerShell to Create New Partition
Sep 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create New Partition

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to create a new partition on a disk.  How can I use Windows PowerShell to create a new partition on a disk?  Use the New-Partition cmdlet, specify the disk number, and assign a new drive letter and size, for example: New-Partiton -DiskNumber 2 -UseMaximumSize -AssignDriveLetter

Weekend Scripter: Overloaded Class Constructors in PowerShell 5—The Video
Sep 12, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Overloaded Class Constructors in PowerShell 5—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, introduces a video about overloaded class constructors in Windows PowerShell 5.0 in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. This is my birthday weekend, so today the Scripting Wife decided to take me to Tampa for the air show. As it turns out, my buddy and Microsoft evangelist, Blain Barton, is also going to show up at the air show.Blain and I are planning to make another IT Time video. Our last video became one of the most popular videos on Channel 9, and it was even featured on the front page of Channel 9 news for a while. Check it out: "Offshore...

PowerTip: Clone Virtual Disk with PowerShell
Sep 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Clone Virtual Disk with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to clone a virtual disk.  How can I use Windows PowerShell to clone a virtual disk?  Use the New-VirtualDiskClone cmdlet, for example: New-VirtualDiskClone –virtualDiskFriendlyName “mydata” –TargetVirtualDiskName “ClonedData” –TargetStoragePoolName “ClonePool”

Overriding Inheritance in PowerShell 5 Classes
Sep 11, 2015
Post comments count 0
Post likes count 0

Overriding Inheritance in PowerShell 5 Classes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about overriding inheritance in Windows PowerShell 5.0 classes. Microsoft Scripting Guy, Ed Wilson, is here. One of the things that is pretty cool about Windows PowerShell 5.0 classes, is that I can override the things I inherit from a base class. This offers a lot of flexibility because it means that when I inherit from a class, I can customize my new class based on my needs instead of being stuck with a lot of stuff that does not meet the requirements. One thing I need to do is to override a couple of the properties that I inherit from my Vehicle base class. Th...

PowerTip: Use PowerShell to Create New GUID
Sep 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create New GUID

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to create a new GUID.  How can I use Windows PowerShell to easily generate a new GUID for a project.?  Use the New-Guid cmdlet.   If you need to create more than one, you can use code such as the following (% is an alias for Foreach-Object): 1..4 | % {new-guid}

Use Inheritance in PowerShell 5 Classes
Sep 10, 2015
Post comments count 0
Post likes count 0

Use Inheritance in PowerShell 5 Classes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using inheritance with Windows PowerShell 5.0 classes in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. Today I want to talk about class inheritance with Windows PowerShell 5.0 in Windows 10. In Introduction to PowerShell 5 Classes, I talked about class design and I mentioned how important it was to spend time designing classes before you begin the writing. As it turns out, I did not really do that. In PowerShell 5: Create Simple Class, I designed a Car class, but you know what? Nearly every property, method, and enum that I designed for the Car c...

PowerTip: Find Class Constructors in PowerShell 5
Sep 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Class Constructors in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily find class constructors.  How can I use Windows PowerShell 5.0 to find the constructor overloads for a new class I want to create?  Place the class in square brackets, and call the static New method with no parentheses, for example: [datetime]::new

PowerShell 5 Classes: Constructor Overloading
Sep 9, 2015
Post comments count 0
Post likes count 0

PowerShell 5 Classes: Constructor Overloading

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the new Windows PowerShell 5.0 class feature in Windows 10 and doing constructor overloading. Microsoft Scripting Guy, Ed Wilson, is here. Today I want to talk about overloaded constructors. I know, I know, I know… It sounds like some sort of engineering failure. But that is not the case. In fact, constructor overloading makes your code much more flexible, and even easier to read—when you learn the trick. And today we are going to unmask the secrets of constructor overloading with Windows PowerShell 5.0 classes in Windows 10. This is way cool stuff...

PowerTip: Quickly Fix a Volume with PowerShell
Sep 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Quickly Fix a Volume with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to perform a quick fix on a volume.  How can I use Windows PowerShell to perform a quick fix on a volume that is somewhat suspect?  Use the Repair-Volume cmdlet and specify the drive letter and the SpotFix parameter, for example: Repair-Volume -DriveLetter E -SpotFix

Adding Methods to PowerShell 5 Classes—The Video
Sep 8, 2015
Post comments count 0
Post likes count 0

Adding Methods to PowerShell 5 Classes—The Video

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, presents a video about adding methods to Windows PowerShell 5 classes in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. Today I am presenting a video where I talk about adding methods to Windows PowerShell 5.0 classes in Windows 10. To be honest, a class with no methods does not do too much. In the video, I talk about methods that are simply called with no parameters and about methods that require input parameters to work properly. This makes classes in Windows PowerShell 5.0 very powerful.Note For more information, refer to Adding Methods to a Power...

PowerTip: Use PowerShell to Check Volume for Errors
Sep 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Check Volume for Errors

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to check a volume for errors.  How can I use Windows PowerShell 5.0 to check a volume for errors on my Windows 10 computer?  Use the Repair-Volume cmdlet, and specify the Scan parameter, for example: Repair-Volume -DriveLetter E -Scan

Create PowerShell 5 Classes with Enums—The Video
Sep 7, 2015
Post comments count 0
Post likes count 0

Create PowerShell 5 Classes with Enums—The Video

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, presents a video about creating Windows PowerShell 5.0 classes by using enums in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. Today, I continue my video series about creating classes. I create a couple of enums and use them as types for my properties of the Car class.Note  For more information, refer to Adding Enums to PowerShell 5 Classes.[View: is a link to the video from YouTube if you would like to download it or play it offline in a different video player: Using Enums In PowerShell Classes by Ed Wilson.Please join me tomorrow when I will prese...

PowerTip: Set Network Connection Profile with PowerShell
Sep 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Set Network Connection Profile with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to configure the network connection profile.  How can I use Windows PowerShell to set the network connection profile for my network adapter?  Use the Get-NetAdapter cmdlet to retrieve a network adapter, pipe it to the Set-NetConnectionProfile cmdlet,            and specify the network category, for example: Get-NetAdapter | Set-NetConnectionProfile -NetworkCategory Private

Weekend Scripter: Create a Simple PowerShell 5 Class—The Video
Sep 6, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Create a Simple PowerShell 5 Class—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video about adding members to Windows PowerShell 5.0 classes in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. Today I want to present a video I made that illustrates how to create a simple Windows PowerShell 5.0 class. In the video, I cover using the Class and Static keywords, and how to constrain the types of properties. I also show a simple way to create an instance of the class and how to add values to the properties of the class. Note  For more information, refer to PowerShell 5: Create Simple Class.[View: is a link to the video ...

PowerTip: Use PowerShell to Determine Network Connection Profile
Sep 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Determine Network Connection Profile

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to determine the network connection profile.  How can I use Windows PowerShell to determine the network connection profile            my network adapter has picked up?  Use the Get-NetConnectionProfile cmdlet.

Weekend Scripter: Introduction to PowerShell 5 classes—The Video
Sep 5, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Introduction to PowerShell 5 classes—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video to introduce Windows PowerShell 5 classes in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. It is a wonderful morning here in central Florida. The sun is already shining, and I am thinking about heading out to take some cool nature pictures. The land around here is quite impressive—wild, untamed, and seemingly unchanged for the last thousand years. In fact, some of the trees seem to have been around for about that long.One thing that does not remain static is Windows PowerShell. With Windows PowerShell 5.0, we now have some impressi...

PowerTip: Use PowerShell to Clean Up Temp Files
Sep 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Clean Up Temp Files

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to delete temporary files.  How can I use Windows PowerShell to clean up a bunch of files that are stored in my temp directory?  Use the Get-ChildItem cmdlet (dir is an alias), point it to the $env:temp directory, and pipe the results            to the Remove-Item cmdlet, for example: dir $env:TEMP -Recurse | Remove-Item -Force -Recurse

Adding Methods to a PowerShell 5 Class
Sep 4, 2015
Post comments count 0
Post likes count 0

Adding Methods to a PowerShell 5 Class

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about adding methods to a Windows PowerShell 5.0 class in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. Having a bunch of properties, although cool, is in the end, rather unsatisfying. I remember trying to teach VBScript and WMI in the old days. Although it was possible to glean lots of information, there were few things that actually did anything. I could easily find the name and the driver of the sound card, but I could not disable the sound card. I could find the screen resolution, but I could not change the screen resolution. I could find the curre...

PowerTip: Use PowerShell to Find ETW Providers
Sep 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find ETW Providers

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find Event Trace for Windows (ETW) providers.  How can I use Windows PowerShell 5.0 to see what Event Trace for Windows (ETW) providers are installed            on my computer running Windows 10?  Open the Windows PowerShell console with Admin rights, and use the Get-ETWTraceProvider cmdlet.

Creating Instances of PowerShell 5 Classes
Sep 3, 2015
Post comments count 0
Post likes count 0

Creating Instances of PowerShell 5 Classes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating instances of Windows PowerShell 5.0 classes in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. Today I am up early. I have the windows open, and I am enjoying the early morning breeze that precedes the midmorning sun and afternoon thunderstorms. I am looking over some of the comments about this week’s series of Hey, Scripting Guy! Blog posts, and I see that someone didn’t like the way I spelled Camero in my code. Oh well, I probably should have stuck with BMW Z-3 or Z-4. Someone else mentioned that there are three-wheel ca...

PowerTip: Use PowerShell to View Appx Log
Sep 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to View Appx Log

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to view the Appx log for deployment messages.  How can I use Windows PowerShell 5.0 in Windows 10 to examine the Appx log for deployment messages?  Use the Get-AppxLog cmdlet and filter on ID 603: Get-AppxLog | Where id -eq 603

Adding Enums to PowerShell 5 Classes
Sep 2, 2015
Post comments count 0
Post likes count 0

Adding Enums to PowerShell 5 Classes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about adding enums to Windows PowerShell 5.0 classes in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. It is my birthday week...almost. It is the kind of thing that one needs to begin making plans and preparations for. I know that the Scripting Wife, aka Teresa, is busy working to make this birthday week one of the best ever—at least, I hope that is what she is up to. The cool thing is that after my birthday week, it will be time for her birthday week, so we take pretty much the entire month of September to celebrate birthdays. Then it is October,...

PowerTip: Verify Default Output Encoding in PowerShell
Sep 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Verify Default Output Encoding in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to verify your default output encoding in Windows PowerShell.  How can I use Windows PowerShell to verify my default output encoding?  Check the value of the $OutputEncoding automatic variable: PS C:\> $OutputEncoding

PowerShell 5: Create Simple Class
Sep 1, 2015
Post comments count 0
Post likes count 0

PowerShell 5: Create Simple Class

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating a simple class in Windows PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. The good news is that so far the weather person has been wrong—every single day for the last five days in a row. The bad news is that, well, unfortunately, I believed the weather person, and so I have been huddled in at home, looking out the windows for a storm that never arrived. We have had a little bit of rain, but not even the normal afternoon thunder storms. Guess I shouldn’t complain, but I was hoping to go take pictures of alligat...

PowerTip: Float PowerShell Help
Aug 31, 2015
Post comments count 0
Post likes count 0

PowerTip: Float PowerShell Help

Doctor Scripto
Doctor Scripto

Summary: Learn how to display your Windows PowerShell Help in a new window.  How can I keep my Windows PowerShell Help open so I can look at it while I am trying my new code?  Use the ShowWindow parameter. It will open a new window that contains your Help and allow you to move            it around on your screen. More importantly, it returns your Windows PowerShell console back to you.            Here is such a command: Get-Help about_Classes -ShowWindow

Introduction to PowerShell 5 Classes
Aug 31, 2015
Post comments count 0
Post likes count 0

Introduction to PowerShell 5 Classes

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell 5 classes in Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. It is an interesting morning. We are up early, looking around, and trying to decide if the latest tropical storm is going to become a hurricane...and if it is going to hit or miss Florida.Of course, in Central Florida, we will get a miss, but still it could mean several days of high winds, lots of rain, a bit of flooding, and perhaps some power outages. So we need to stock up on food and water, and fill up the vehicles with petrol. I am thinking we need to make sure we h...

PowerTip: Retrieve Last Token with PowerShell
Aug 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Retrieve Last Token with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to retrieve the last token and avoid retyping. I used Get-Process to view a process I launched, and later I wanted to stop the process. How can I do this without            doing a lot of typing or creating new variables? The $$ automatic variable contains the last token submitted, so do the following:PS C:\> notepadPS C:\> gps $$Handles  NPM(K)    PM(K)    WS(K) VM(M)   CPU(s)   Id ProcessName-------     ------    -----  &nb...

Weekend Scripter: PowerShell 5 Enums—The Video
Aug 30, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell 5 Enums—The Video

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, presents a video where he recaps his blog posts about Windows PowerShell 5.0 enums.Microsoft Scripting Guy, Ed Wilson, is here. Today I decided to make a video to summarize my technique for working with enums in Windows PowerShell 5.0 in Windows 10.Note  For more information, refer to New PowerShell 5 Feature: Enumerations and Working with Enums in PowerShell 5.[View: is a link to the video from YouTube if you would like to download it or play it offline in a different video player: Windows PowerShell Enums by Ed Wilson.I invite you to follow me on Twitter an...

PowerTip: Find Specific Help Articles with PowerShell
Aug 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Specific Help Articles with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily find specific Help articles with Windows PowerShell.  How can I use Windows PowerShell to find a Help article about automatic variables, if I am not sure of the title?  Use the Get-Help cmdlet and begin with about_ , then press Tab expansion. It will cycle through matches.            If you think the article is about_automatic_Variables, you can begin with the following command: Help about_a<tab> To quickly find the specific article, when the title appears, press ENTER to retrieve the article.

Weekend Scripter: PowerShell Module Manifests—The Video
Aug 29, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell Module Manifests—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson presents a recap video where he talks about Windows PowerShell module manifests.Microsoft Scripting Guy, Ed Wilson, is here. It has been stormy for the last couple of days. It makes for a great time to spend offline playing around with my Windows 10 laptop or Surface Pro 3. Watching the power of the storms is great fun, especially if I am not directly in the path. The way the storm parades across the flat Florida plain makes it really easy to watch it approach. It is like watching a giant storm switch that is flipped from off to on, and then back again.Anyway, I decided to make a video rec...

PowerTip: See Number of Errors in PowerShell Session
Aug 28, 2015
Post comments count 0
Post likes count 0

PowerTip: See Number of Errors in PowerShell Session

Doctor Scripto
Doctor Scripto

Summary: Learn how to determine how many errors there are in the Windows PowerShell session.  How can I determine how many current errors there are in my Windows PowerShell session?  Use the Count property from the Error object array: $error.count

August 2015 PowerShell Spotlight
Aug 28, 2015
Post comments count 0
Post likes count 0

August 2015 PowerShell Spotlight

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about community activities.Microsoft Scripting Guy, Ed Wilson, is here. In case you haven’t noticed, I have been turning the keyboard over to Teresa (PowerShell MVP, and my real life wife, aka the Scripting Wife) once a month so she can spotlight community happenings. Today is the day for her August post. Take it away Teresa...Greetings everyone.I hope you have had a scriptastic month. I have been looking at the calendar and checking the RAM in my head to share upcoming events with you.The first item is the Nashville PowerShell User Group meeting. The ...

PowerTip: Find Numeric Value of Enum in PowerShell
Aug 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Numeric Value of Enum in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily find the numeric value of an enum in Windows PowerShell.  How can I use Windows PowerShell to easily find the numeric value of an enumeration?  Use square brackets to call the enum, call the enumeration property as a static property, and reference3            the value__ property. Here is an example using the [fruit] enum created in yesterday’s post,            New PowerShell 5 Feature: Enumerations: [fruit]::apple.value__

Working with Enums in PowerShell 5
Aug 27, 2015
Post comments count 0
Post likes count 0

Working with Enums in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about working with enums in Windows PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. Yesterday, I talked about the new stealth feature in Windows PowerShell 5.0 in Windows 10 that permits me to easily create an enum. Enums are great because they provide a concise way for me to check parameters, a great way to make code easier to read, and many other things. Note  Today's post continues New PowerShell 5 Feature: Enumerations. You should read it prior to reading today's post. Awhile back, I wrote a function called Get-EnumVa...

PowerTip: See Enumeration Value in PowerShell
Aug 26, 2015
Post comments count 0
Post likes count 0

PowerTip: See Enumeration Value in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to retrieve an enumeration value in Windows PowerShell.  How can I see enumeration allowed values in Windows PowerShell? Place the enumeration name in square brackets, and use the double colon syntax to retrieve a specific property.          IntelliSense will show you permissible values. Here is an example using an enumeration called Fruit: [fruit]::pear

New PowerShell 5 Feature: Enumerations
Aug 26, 2015
Post comments count 0
Post likes count 0

New PowerShell 5 Feature: Enumerations

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating enumerations in Windows PowerShell 5.0. Microsoft Scripting Guy, Ed Wilson, is here. It is nearly a stealth feature in Windows PowerShell 5.0—there is an Enum keyword. Yep, that's right, there is an Enum keyword. I wonder what it does? Probably has something to do with creating enums. Is this a big deal? You betcha...as they may say in some places. Why? Because prior to Windows PowerShell 5.0, you had to basically create an enum by using C# kinds of code, and then adding it as a type. Did it work? Sure it did. Was it Windows PowerShell? ...

PowerTip: Find Custom Default PowerShell Parameter Values
Aug 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Custom Default PowerShell Parameter Values

Doctor Scripto
Doctor Scripto

Summary: Learn how to find custom default Windows PowerShell parameter values.  How can I find what custom default Windows PowerShell parameter values I have set up on my            Windows PowerShell console?  Check the value of the $PSDefaultParameterValues variable, for example: PS C:\> $PSDefaultParameterValues

Add Default Values for PowerShell Module Manifest
Aug 25, 2015
Post comments count 0
Post likes count 0

Add Default Values for PowerShell Module Manifest

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about adding default values to your Windows PowerShell module manifest.  Hey, Scripting Guy! I kind of like the idea of creating a manifest for my Windows PowerShell module, but it seems like a lot of busy work. I mean, I seem to always be typing the same thing over and over. I wish there was an easy way to set default values for the module manifest. I thought about taking a blank module manifest, adding default values, and then manually editing the manifest when I needed to customize it… but that seems like a lot of work. Is there an easier way to do...

PowerTip: Find Path to PowerShell Module
Aug 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Path to PowerShell Module

Doctor Scripto
Doctor Scripto

Summary: Easily find the path to a Windows PowerShell module.  How can I easily find the location where a Windows PowerShell module is installed?  Use the Path property from the PSModuleInfo object that returns from the Get-Module cmdlet, for example: (Get-Module Microsoft.PowerShell.Utility).path

Verify PowerShell Module Manifests
Aug 24, 2015
Post comments count 0
Post likes count 0

Verify PowerShell Module Manifests

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about verifying Windows PowerShell module manifests. Microsoft Scripting Guy, Ed Wilson, is here. One of the things that is cool about Windows PowerShell is that it is self-describing. I can type Get-Member or Get-Command and find out what a Windows PowerShell cmdlet is all about. Then there is Get-Help, which also provides way cool information. When cmdlets ship in Windows PowerShell modules, there are additional tools available. I can use Get-Module to see what a module contains. But there is more… I can look at the module manifest. When I create a Windo...

PowerTip: Find Network Adapters that Are Up
Aug 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Network Adapters that Are Up

Doctor Scripto
Doctor Scripto

Summary: Find your network adapters that are available.  How can I use Windows PowerShell to find which network adapters on my computer are up?  Use the Get-NetAdapter cmdlet and filter on the status, for example: (Get-NetAdapter).where{$_.status -eq 'up'} Note  This command works on Windows 8.1 and later.

Weekend Scripter: Parse NetStat with PowerShell 5—The Video
Aug 23, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Parse NetStat with PowerShell 5—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, shares a video he made that illustrates parsing NetStat with Windows PowerShell 5.0.Microsoft Scripting Guy, Ed Wilson, is here. For someone who loves working at the command line, the new ConvertFrom-String cmdlet is awesome. I mean, I can do things in a single line of code that in the past, took 15 or 20 lines of code. This means less scripting and more production work.Today, I am presenting a video to illustrate parsing the output of the NetStat command via Windows PowerShell, but this is simply the surface of how powerful this technique is.[View:https://www.youtube....

PowerTip: Use PowerShell to Find Current Connection Profile
Aug 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Current Connection Profile

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find your current connection profile.  How can I use Windows PowerShell to see what connection profile my computer is using?  Use the Get-NetConnectionProfile cmdlet.

Weekend Scripter: Create Objects from Strings—The Video
Aug 22, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Create Objects from Strings—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell 5.0 to create objects from strings in this video.Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about Windows PowerShell is that it is object-oriented. This means that I can easily pipe objects, sort objects, and compare objects.In Windows PowerShell 5.0, this becomes even easier, because I can create objects from strings. Today I present a video to illustrate this technique:[View:https://www.youtube.com/watch?v=JQlOaRy0BMc&feature=youtu.be:550:0]Here is a link to the video from YouTube if you wou...

PowerTip: Use PowerShell Tab Expansion to Navigate Registry
Aug 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell Tab Expansion to Navigate Registry

Doctor Scripto
Doctor Scripto

Summary: Use the Windows PowerShell tab expansion feature to quickly navigate the Windows registry.  How can I use Windows PowerShell to explore settings in the Windows registry?  Use a cmdlet like Get-Item, Get-ItemProperty, or Get-ItemPropertyValue, specify the drive (such as HKCU),             and then press the Tab key to navigate the registry, for example: Get-ItemProperty HKCU:\SOFTWARE\ <TAB>

New PowerShell 5 Feature Provids Better Registry Support
Aug 21, 2015
Post comments count 0
Post likes count 0

New PowerShell 5 Feature Provids Better Registry Support

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about a new feature in Windows PowerShell 5.0 that providers better registry support. Microsoft Scripting Guy, Ed Wilson, is here. The Windows PowerShell registry drive has always been somewhat of a love-hate relationship with me. I mean, it makes such great sense to be able to work with the registry via Windows PowerShell, but still, it always seemed a bit backwards. I know lots of people who stuck with using the .NET registry classes, the old RegRead and RegWrite methods from the VBScript days, or even WMI to work with the registry. Clearly, there was something...

PowerTip: See What Update-Help Does on Your System
Aug 20, 2015
Post comments count 0
Post likes count 0

PowerTip: See What Update-Help Does on Your System

Doctor Scripto
Doctor Scripto

Summary: Learn how to see what the Update-Help cmdlet does on your system.  How can I see what Update-Help does on my Windows 10 computer—if anything?  Open the Windows PowerShell console with Admin rights, type Update-Help, and add the –Verbose switch.             It will list everything that it does, the versions of Help that are current, and which versions are updated.             Here is such a command: Hpdate-Help -Module * -Force -Verbose

The New Raw-File Version Information in PowerShell 5
Aug 20, 2015
Post comments count 0
Post likes count 0

The New Raw-File Version Information in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about looking at raw-file version information by using Windows PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here, and it is finally here. It seems like waiting for a major holiday to appear. Yes! It is nearly time for the Atlanta TechStravaganza. I just got an email yesterday from another Windows PowerShell MVP who will be attending. Cool. Tonight is the “speakers dinner.” By that, I guess they mean, speakers and others—that is, whoever happens to be around and whoever signed up for the dinner will be permitted to ha...

PowerTip: Find Running Services on Your Workstation
Aug 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Running Services on Your Workstation

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily find all running services on your workstation.  How can I use Windows PowerShell to find what services are running on my workstation?  Use the Get-Service cmdlet, filter the status on the word Running, and select the display name of the services,           for example: gsv | where status -eq 'running' | select displayname Note  gsv is an alias for the Get-Service cmdlet.

Parsing NetStat Information with PowerShell 5
Aug 19, 2015
Post comments count 1
Post likes count 0

Parsing NetStat Information with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about parsing output from NetStat with Windows PowerShell 5.0.  Hey, Scripting Guy! I need a good way to parse output from the NetStat command. I use it all the time, but it ends up requiring me to spend a lot of time looking through stuff. I am not sure if the command itself has a filter language or what, but I really need to be able to parse on the fly. I have even gone so far as run the command, copy it to the clipboard, paste it into Notepad, and then go through the Notepad file adding characters so I could import it into Excel and filter the output. But...

PowerTip: Find Processes with High Priority
Aug 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Processes with High Priority

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find processes that have a high priority.  How can I use Windows PowerShell to quickly see what processes have a high priority or an above normal priority?  Open Windows PowerShell with Admin rights, use the Get-Process cmdlet to return processes, and filter            processes that are using high or above normal priority, for example: gps | where {$_.priorityclass -eq 'AboveNormal' -OR $_.priorityclass -eq 'high'} | select name, priorityclass

Use New PowerShell 5 Cmdlet to Create Objects from Strings
Aug 18, 2015
Post comments count 0
Post likes count 0

Use New PowerShell 5 Cmdlet to Create Objects from Strings

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using a new Windows PowerShell cmdlet to create objects from strings.  Hey, Scripting Guy! It seems that even though Windows PowerShell 5.0 in Windows 10 has a lot of cool new stuff, I still end up using command-line utilities. I don’t know if it is just me, or if there are still some things that are missing. I can get useful information from these command-line utilities, but I miss the experience of having an object that I can easily sort and filter. I guess what I am really wishing is that I had either more Windows PowerShell cmdlets or a way t...

PowerTip: Recurse Specific Number of Levels with PowerShell 5
Aug 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Recurse Specific Number of Levels with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to recurse a specific number of levels in a directory with Windows PowerShell 5.0.  How can I recurse only three levels into a deeply nested directory structure?  In Windows PowerShell 5.0, the Get-ChildItem cmdlet has a new –Depth parameter            that will control how deeply to recurse, for example: Get-childitem c:\fso –recurse –depth 3

Use the PowerShell 5 Convert-String Cmdlet
Aug 17, 2015
Post comments count 0
Post likes count 0

Use the PowerShell 5 Convert-String Cmdlet

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the new Convert-String cmdlet in Windows PowerShell 5.0 to manipulate strings. Microsoft Scripting Guy, Ed Wilson, is here. Over the weekend, the Scripting Wife and I headed out and about to explore central Florida. We found a really cool lake town that had an awesome tea shop. We also saw some pretty cool birds walking around. Here is one bird that was just hanging out—to be honest, I think he was bumming scones, but as it turned out he was out of luck—I ate all the scones I had. Anyway, exploring is lots of fun and an interesting way to...

PowerTip: Looking at Logs with PowerShell
Aug 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Looking at Logs with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Find logs that are not enabled with Windows PowerShell.  How can I use Windows PowerShell to quickly see which logs in the event log tool are not enabled by default?  Use the Get-WinEvent cmdlet to produce a list of all the logs, then pipe the results to the Where-Object cmdlet,            and specify that you want those that are not enabled, for example: Get-WinEvent -ListLog * -ea 0 | where {-not ($_.isenabled)} Note   Many logs require elevated permissions for access. Either launch Windows PowerShell with elevated rights, or sp...

Weekend Scripter: Expanding Compressed Archives—The Video
Aug 16, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Expanding Compressed Archives—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, created a video that illustrates expanding compressed archives with Windows PowerShell 5.0.Microsoft Scripting Guy, Ed Wilson, is here. There is a gigantic shaggy dog looking in the window at me. I think it is a North American slobber hound, but then I have never been great at identifying shaggy dogs. One canine pretty much looks like another. I mean, I can tell the difference between Lassie, Snoopy, and Marmaduke, but that is about the extent of my expertise in the doggie ID department.Ever since I received a rather painful bite on the back of the leg from a “fr...

PowerTip: Get Latest Entry from Event Log with PowerShell
Aug 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Latest Entry from Event Log with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get the latest entry from an event log.  How can I use Windows PowerShell to see the most recent entry from the application log?  Use the Get-EventLog cmdlet, specify the log name, and use the –Newest 1 parameter, for example: Get-EventLog application -Newest 1

Weekend Scripter: Compressed Archives—The Video
Aug 15, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Compressed Archives—The Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, created a video to illustrate using Windows PowerShell 5.0 to create compressed archives.Microsoft Scripting Guy, Ed Wilson, is here. The sky is a deep blue, and the early morning haze on the horizon hides the fluffy white clouds causing them to blend into the sky like a brush stroke by an impressionist painter.I am sitting outside with my Surface Pro 3 under a huge oak tree that looks like it is a thousand years old. I brought a pot of Earl Grey tea with me. I added some lavender to the pot while my leaves were steeping. It is a beautiful morning to be out a...

PowerTip: Use PowerShell 5 to Compress Files
Aug 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell 5 to Compress Files

Doctor Scripto
Doctor Scripto

Summary: Learn how to use the new Compress-Archive cmdlet to compress selected files in Windows PowerShell 5.0.  How can I compress a bunch of files on my computer that match a pattern I supply to Get-ChildItem?  Use Get-ChildItem to find the files you want to compress, and pipe the results to the Compress-Archive cmdlet,            for example (gci is an alias for Get-ChildItem): gci c:\fso\*.txt | Compress-Archive -DestinationPath c:\fso\myarchive.zip

Working with Compressed Files in PowerShell 5
Aug 14, 2015
Post comments count 0
Post likes count 0

Working with Compressed Files in PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the new compressed file cmdlets in Windows PowerShell 5.0 on Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. It finally happened. I ran out of Gunpowder Green tea over the weekend. I have been making lots of Gunpowder Green tea with hibiscus flowers, rose hips, lemon grass, and other combinations, and then chilling it down. It works great for the central Florida August afternoons (and indeed sometimes early morning and even late at night).I still have lots of black tea, lots of herbs, and even a pound or so of Oolong tea. So I have decided I am goin...

PowerTip: Find Automatic Variables that Begin with Letter
Aug 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Automatic Variables that Begin with Letter

Doctor Scripto
Doctor Scripto

Summary: Find automatic variables in Windows PowerShell that begin with a specific letter.  How can I find automatic variables in Windows PowerShell that begin with the letter P?  Use the drive Windows PowerShell variable provider with a wildcard character after the letter P: DIR variable:P*

New Feature in PowerShell 5: Compress Files
Aug 13, 2015
Post comments count 0
Post likes count 0

New Feature in PowerShell 5: Compress Files

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the compressing files feature in Windows PowerShell 5.0. Microsoft Scripting Guy, Ed Wilson, is here. This morning, the sun is shining, the air is dead calm, and I am sitting outside under a gigantic old oak tree with my Windows Surface Pro 3 that I upgraded to Windows 10. I am sipping a cup of English Breakfast tea with a bit of lemon grass, crushed mint leaves, and cinnamon stick while looking over Twitter. I see lots of people tweeting about Windows PowerShell 5.0. That is a good thing because there are lots of good things in Windows PowerShell 5.0....

PowerTip: View All Available Modules
Aug 12, 2015
Post comments count 0
Post likes count 0

PowerTip: View All Available Modules

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to view all available modules in Windows PowerShell.  How can I view all of the available modules in my current Windows PowerShell session?  Run Get-Module with the –ListAvailable parameter: Get-Module –ListAvailable

Use PoshUSNJournal Module to Work with Change Journal
Aug 12, 2015
Post comments count 0
Post likes count 0

Use PoshUSNJournal Module to Work with Change Journal

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to use the PoshUSNJournal module to work with the USN change journal. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today, filling in for my good friend, the Scripting Guy. I'm finishing up my three-day stint on the Hey, Scripting Guy! Blog. Be sure to catch up by reading: Today, I will demo my module called PoshUSNJournal and show you how to use it with the change journal. I have taken you on the journey of using Windows PowerShell along with PInvoke via reflection to hook into the Windows API to view the change journal and look at the entries to see what ...

PowerTip: Determine if PowerShell is Running x86 or x64
Aug 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine if PowerShell is Running x86 or x64

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to determine if Windows PowerShell is running x86 or x64.  How can I use Windows PowerShell to determine if I am running x86 or x64?  Use [intptr]::Size as follows: Switch ([intptr]::Size) {     4 {"x86"}     8 {"x64"}       }

View Entries in USN Change Journal
Aug 11, 2015
Post comments count 0
Post likes count 0

View Entries in USN Change Journal

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows us how to view the entries in the USN change journal. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today, filling in for my good friend, the Scripting Guy. Today I'm continuing on from yesterday’s post, Connect to USN Change Journal. In today’s post, I'll look at the actual entries of the journal, which will show us information about the files and folders that are being created, modified, and deleted. Much like yesterday, I need to create some methods through reflection in addition to some Structs and Enums to handle some of the work that I will b...

PowerTip: Use PowerShell to List Exported Types
Aug 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to List Exported Types

Doctor Scripto
Doctor Scripto

Summary: Boe Prox shows how to use Windows PowerShell to list exported types.  How can I use Windows PowerShell to list all of the exported types?  Use this command:  [appdomain]::CurrentDomain.GetAssemblies()|ForEach {     Try {         $_.GetExportedTypes()     } Catch {} }

Connect to USN Change Journal
Aug 10, 2015
Post comments count 0
Post likes count 0

Connect to USN Change Journal

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Boe Prox, shows us how to connect to the USN change journal by using Windows PowerShell. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today, filling in for my good friend, the Scripting Guy. Over the course of the next few days, I am going to be talking about a topic that many of you might not have heard about, which deals with the update sequence number (USN) change journal. We will use Windows PowerShell to take a walk-through, with help from PInvoke, to connect to the change journal and view the entries within the journal. First, a quick overview of the USN...

PowerTip: Find Commands and Descriptions from Module
Aug 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Commands and Descriptions from Module

Doctor Scripto
Doctor Scripto

Summary: Find commands and their descriptions exported from a Windows PowerShell module.  How can I see the commands with their descriptions that are available in a new Windows PowerShell module?  Use the Get-Command (gcm is an alias) cmdlet and specify the module. Then select the name and create            a custom property to retrieve the description from Get-Help, for example: gcm -Module psreadline | select name, @{L='description'; E={(get-help $_).description.text}}

Weekend Scripter: PowerShell 5 Overview Video
Aug 9, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: PowerShell 5 Overview Video

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, presents a video he made as an overview of Windows PowerShell 5.0.Microsoft Scripting Guy, Ed Wilson, is here. It has been a great week. It is a nice sunny day here in central Florida, and I am sipping a cup of Earl Grey tea. I decided to make a video to summarize the things I have been talking about with Windows PowerShell 5.0. Sometimes it is just easier to say things in a video. Windows PowerShell 5.0 Overview video by Ed WilsonI invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post ...

PowerTip: Find Commands Exported by PowerShell Module
Aug 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Commands Exported by PowerShell Module

Doctor Scripto
Doctor Scripto

Summary: Find commands that are exported by a Windows PowerShell module.  How can I see what commands a Windows PowerShell module provides?  There are two quick ways to find commands exported by a Windows PowerShell module. The first expands the ExportedCommands property from a module (gmo is an alias for the Get-Module cmdlet): gmo PSReadline | select -ExpandProperty exportedcommands The second uses the Get-Command cmdlet (gcm is an alias for Get-Command): gcm -Module PSreadline

Weekend Scripter: A Week's Worth of Windows 10
Aug 8, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: A Week's Worth of Windows 10

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks more about his first impressions of Windows 10.Microsoft Scripting Guy, Ed Wilson, is here. I will admit that I am not a typical user—of anything, as far as that goes, but certainly not of desktop operating systems. So my thoughts about Windows 10 may or may not, be relevant.First of all, I can say that I have been "using" Windows 10 for about a year because I get the daily builds. But this is not all that true because installing Windows 10 and immediately launching Windows PowerShell hardly counts as using Windows 10. So in reality, my ...

PowerTip: Find Cmdlets with NoNewLine Parameter
Aug 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Cmdlets with NoNewLine Parameter

Doctor Scripto
Doctor Scripto

Summary: Easily find Windows PowerShell 5.0 cmdlets with the NoNewLine parameter.  I heard that Windows PowerShell 5.0 introduces a NoNewLine parameter for some cmdlets, but how can I            find the cmdlets?  Use the Get-Command cmdlet (gcm is an alias), and search for the ParameterName of NoNewLine: gcm -ParameterName nonewline

The PowerShell 5 NoNewLine Parameter
Aug 7, 2015
Post comments count 0
Post likes count 0

The PowerShell 5 NoNewLine Parameter

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the NoNewLine parameter in Windows PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. In addition to new cmdlets in Windows PowerShell 5.0, there are also improvements to existing cmdlets. These improvements are often really cool because it means I can use the old cmdlets in new ways, which is just about like having a new cmdlet. These add-ons (if you will) are not as easy to find as a whole brand new cmdlet. I mean, a brand new cmdlet is pretty easy to find with Get-Command because all I need to do is type Get-Command, and search fo...

PowerTip: Find Alias for PowerShell Cmdlet
Aug 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Alias for PowerShell Cmdlet

Doctor Scripto
Doctor Scripto

Summary: Learn how to find an alias for a specific Windows PowerShell cmdlet.  How can I find is there is an alias for a specific Windows PowerShell cmdlet that I use a lot?  Use the Get-Alias cmdlet, specify the –Definition parameter, and supply the name of the cmdlet, for example: Get-Alias -Definition Get-CimClass

Playing Around with Format-Hex
Aug 6, 2015
Post comments count 0
Post likes count 0

Playing Around with Format-Hex

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the Format-Hex cmdlet in Windows PowerShell 5.0. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about Windows PowerShell is that it usually just works. Well of course, after you learn how, it just works. For example, it is largely self-describing, and it has standard parameters. Other cmdlets that use parameters with similar names generally take pains to ensure that those parameters work the same way. For example, the Path parameter is not a standard parameter. Yet, it is usually always called Path, and it generally points to the path t...

PowerTip: Create a GUID with PowerShell 5
Aug 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Create a GUID with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to create a new GUID with Windows PowerShell 5.0.  How can I use Windows PowerShell 5.0 in Windows 10 to create a new GUID?  Use the New-Guid cmdlet:

Create Temporary Files with PowerShell 5
Aug 5, 2015
Post comments count 0
Post likes count 0

Create Temporary Files with PowerShell 5

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating temporary files with Windows PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sipping a nice Gunpowder Green tea with hibiscus leaves and rose hips in it. I also added a bit of lemon grass for taste. I made the tea last night and chilled it. The taste is surprisingly clean and refreshing. Along with some Belgium crisp chocolate sticks, it makes a delightful mid-morning snack. I am stilling playing around with Windows 10 and Windows PowerShell 5.0. I suspect this will probably be a task that will occupy me...

PowerTip: Use PowerShell 5 to Clear Recycle Bin
Aug 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell 5 to Clear Recycle Bin

Doctor Scripto
Doctor Scripto

Summary: Learn how to clear the recycle bin by using Windows PowerShell 5.0 in Windows 10.  How can I use Windows PowerShell to clear the recycle bin in my laptop running Windows 10?  Use the Clear-RecycleBin cmdlet.

Use Transcript Tool in PowerShell ISE
Aug 4, 2015
Post comments count 0
Post likes count 0

Use Transcript Tool in PowerShell ISE

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the Windows PowerShell ISE transcript in PowerShell 5.0 in Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. It is not a secret that I love Windows PowerShell. It is also not a secret that Windows PowerShell keeps getting better and better. One of the things about Windows PowerShell is that if I do not like the way it does something, or if there is a functionality that is missing, I can write my own commands and make my own modifications. In this way, Windows PowerShell extensible, and it is pretty awesome. Something that is also awes...

PowerTip: Find PowerShell Help Content
Aug 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Help Content

Doctor Scripto
Doctor Scripto

Summary: Learn how to find all Windows PowerShell Help content.  I updated the Help files on my installation of Windows PowerShell. I can find the cmdlet Help,            but how can I see the Help text files?  Use the Get-Help cmdlet, search for the HelpFile category, select all of them with a wildcard            character, and then pipe the output to More: Get-Help –category helpfile * | more

Cool Stuff about PowerShell 5.0 in Windows 10
Aug 3, 2015
Post comments count 0
Post likes count 0

Cool Stuff about PowerShell 5.0 in Windows 10

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about cool stuff in Windows PowerShell 5.0 for Windows 10. Microsoft Scripting Guy, Ed Wilson, is here. Over the weekend, I installed Windows 10. It is way cool. I love what we have done with the charms bar…it is gone. I also like the streamlined user interface, the new Edge browser, and especially Windows PowerShell 5.0. I mean, it is awesome. It rocks. By the way, the easiest way to upgrade to Windows PowerShell 5.0 right now, is to upgrade to Windows 10—which by the way, is a free upgrade from Windows 7, 8, and 8.1. For now, that is what...

PowerTip: Install PowerShell Help on PowerShell 5.0
Aug 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Install PowerShell Help on PowerShell 5.0

Doctor Scripto
Doctor Scripto

Summary: Update Help for Windows PowerShell 5.0.  I installed Windows 10 and opened Windows PowerShell, but how can I update the Help for Windows PowerShell 5.0?  Open Windows PowerShell as an Administrator, type Update-Help, select all of the modules, and use the –Force             parameter if you run the command more than once a day: Update-Help –module * -Force

Weekend Scripter: Exploring Windows PowerShell 5.0
Aug 2, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Exploring Windows PowerShell 5.0

Doctor Scripto
Doctor Scripto

Summary: Teresa Wilson, Powershell MVP, talks about exploring Windows PowerShell 5.0 on Windows 10. Teresa Wilson, AKA the Scripting Wife, is here. The Microsoft Scripting Guy, Ed Wilson, is still missing in action. He downloaded Windows 10, and I haven’t seen him since. So I thought I would write about getting Windows PowerShell 5.0 running on Windows 10. The first thing I need to do is find Windows PowerShell 5.0. I type PowerShell in the Web and Windows search box on my task bar. Cortana comes up and locates the Windows PowerShell 5.0 executable. I click the top of the list for the Desktop...

PowerTip: Find What Version of PowerShell You Have
Aug 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Find What Version of PowerShell You Have

Doctor Scripto
Doctor Scripto

Summary: Easily find what version of Windows PowerShell you are running.  I upgraded to Windows 10, but how can I confirm what version of Windows PowerShell I am running?  Use the $psversiontable automatic variable.

Weekend Scripter: Upgrade to Windows 10
Aug 1, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Upgrade to Windows 10

Doctor Scripto
Doctor Scripto

Summary: Teresa Wilson, Windows PowerShell MVP, talks about upgrading to Windows 10. Teresa Wilson, AKA the Scripting Wife, is here. I first wanted to mention that Ed and I will be in Atlanta on August 21 for TechStravaganza. At the time I am writing this there are 22 tickets remaining, so hurry and sign-up if you would like to attend. It is a free event. Ed is somewhere playing with Windows 10, and he left me on my own to upgrade my computer. He says it will be a good experience for me. I am not sure what he really means by that. But I am quite confidant that I can do this, and it will be a good experience. Step...

PowerTip: Download Links from Webpage with PowerShell
Jul 31, 2015
Post comments count 0
Post likes count 0

PowerTip: Download Links from Webpage with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to download links from a webpage.  How can I use Windows PowerShell to easily download links from a webpage that has a lot of links I want?  Use Invoke-WebRequest and select Links and href, for example: (Invoke-WebRequest -Uri "http://www.scriptingguys.com").Links.Href

What’s My PID?
Jul 31, 2015
Post comments count 0
Post likes count 0

What’s My PID?

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, creates a function to capture the process ID of a Windows PowerShell host. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I like to know is the process ID (PID) of specific processes. Often this is trivial. I can use the Get-Process cmdlet and, for example, look to see what the process ID of Notepad.exe is. But what if I have four or five instances of Notepad running? Then it becomes somewhat an exercise in trial and error. This is also true for Windows PowerShell. For example, the Windows PowerShell console process name is PowerShell. No problem. Excep...

PowerTip: Find Most Recent Event Log Entry
Jul 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Most Recent Event Log Entry

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the most recent event log entry.  How can I use Windows PowerShell to see the most recent event log entry from my application log?  Use the Get-EventLog cmdlet and select the application log and the Newest 1 entry: Get-EventLog application -Newest 1

Launch Elevated PowerShell Shell
Jul 30, 2015
Post comments count 0
Post likes count 0

Launch Elevated PowerShell Shell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about launching an elevated Windows PowerShell shell. Microsoft Scripting Guy, Ed Wilson, is here. Today I had a great talk with Steve, the Scripting Manager. One of the things we talked about was the importance of community, and how the Windows PowerShell community seems to be really engaged with the Windows PowerShell team and with other documentation efforts. One of the great things that I love about the Windows PowerShell community is the interaction I have with them at user groups, conferences, and community events (such as the Atlanta TechStravaganza that i...

PowerTip: Use PowerShell to Check Logon Server for Client
Jul 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Check Logon Server for Client

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to check the logon server of your clients.  How can I use Windows PowerShell to verify if my users are trying to sign in to their computers with a Windows account            instead of using their domain credentials?  Check the value of the environmental LOGONSERVER variable: $env:LOGONSERVER If it reports \\MicrosoftAccount, they are using their Windows account to sign in instead of domain credentials. You can check this by using the IF statement as shown here: if($env:LOGONSERVER -match "MicrosoftAccount")...

Use Function to Determine Elevation of PowerShell Console
Jul 29, 2015
Post comments count 0
Post likes count 0

Use Function to Determine Elevation of PowerShell Console

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using a function to determine if a Windows PowerShell console is elevated. Microsoft Scripting Guy, Ed Wilson, is here. I had a friend tell me that nearly half of all the cmdlets, functions, and whatever’s in Windows PowerShell 4.0 on Windows Server 2012 R2 required elevation to Admin rights. I can neither confirm nor deny this assertion, and I have not seen any official documentation about this. But I can tell you, that there are quite a few of these things that do require elevation. For example, the Hyper-V functions (even in Windows&...

PowerTip: Read File with Backtick in Name
Jul 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Read File with Backtick in Name

Doctor Scripto
Doctor Scripto

Summary: Read the content of a text file with a backtick ( ` ) in the name.  How can I use Windows PowerShell to read the content of a file that has a backtick ( ` ) in the file name?  Use single quotation marks around the name when you supply the path to Get-Content, for example: Get-Content 'c:\fso\a file with a `in the name.txt' The following examples fail: Get-Content "c:\fso\a file with a `in the name.txt" Get-Content c:\fso\a file with a `in the name.txt

One of My Favorite PowerShell Functions
Jul 28, 2015
Post comments count 0
Post likes count 0

One of My Favorite PowerShell Functions

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, discusses one of his favorite functions: Get-EnumValues. Microsoft Scripting Guy, Ed Wilson, is here. Today I am working on my presentation for Atlanta TechStravaganza 2015, which will happen on August 21. It will be a really cool event, and the Scripting Wife and I are looking forward to attending it. Unfortunately we were unable to attend last year due to a scheduling conflict, so we are really looking forward to this year. It is always a great event with top-flight speakers. Anyway, I am still messing around with my Windows PowerShell profile... One of my favor...

PowerTip: Find PowerShell Variables Defined for AllScope
Jul 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Variables Defined for AllScope

Doctor Scripto
Doctor Scripto

Summary: Find Windows PowerShell variables that are defined for all scopes.  How can I find  what variables are defined as AllScope in my Windows PowerShell environment?  Get a list of all your variables, and filter for options that include AllScope, for example: (dir variable:).where({$_.options -match 'allscope'})

Describe Your PowerShell Variables
Jul 27, 2015
Post comments count 0
Post likes count 0

Describe Your PowerShell Variables

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about adding a description to variables. Microsoft Scripting Guy, Ed Wilson, is here. There is a “water feature” outside that keeps running and running and running. It is a bit strange, and to be honest, it makes me think that it is raining all the time. In central Florida in the summer, it is generally a safe bet that it will rain, but even when the sun is outside, without a cloud in the sky, the giant frog keeps spitting water into a pond. I don’t get it. It is not relaxing like a Zen pond, and it does not keep bugs at bay like a real frog wou...

PowerTip: Open Temporary Copy of PowerShell Profile
Jul 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Open Temporary Copy of PowerShell Profile

Doctor Scripto
Doctor Scripto

Summary: Open a temporary copy of your Windows PowerShell profile.  How can I look at a temporary copy of my Windows PowerShell profile to ensure that I don’t            accidentally make any changes?  Copy your Windows PowerShell profile to a temporary file, and then open it in the            Windows PowerShell ISE, for example: Copy-Item $PROFILE $([io.path]::GetTempFileName()) -PassThru | % { ise $_.fullname}

Weekend Scripter: Back Up Your PowerShell Profile
Jul 26, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Back Up Your PowerShell Profile

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about automatically backing up your Windows PowerShell profile. Microsoft Scripting Guy, Ed Wilson, is here. My rule for making backups is that when the loss of the item would cause me grief, it is backed up. Otherwise, there is not too much need for a backup. This includes things that are not related to computers in addition to computers, files, and Windows PowerShell profiles. For example, if I go on a trip and I only have a single battery for my camera, would I be upset if that battery dies, drains, or otherwise becomes useless? Maybe. But then again, maybe no...

PowerTip: Launch PowerShell Without a Profile
Jul 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Launch PowerShell Without a Profile

Doctor Scripto
Doctor Scripto

Summary: Learn how to launch Windows PowerShell without using a profile.  I suspect my profile is causing issues with Windows PowerShell. How can I launch Windows PowerShell            without starting the profile?  Use the Run command to launch Windows PowerShell with the –noprofile switch: PowerShell -noprofile

Weekend Scripter: Replace One PowerShell Function with Another
Jul 25, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Replace One PowerShell Function with Another

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about replacing one Windows PowerShell function with a different one. Microsoft Scripting Guy, Ed Wilson, is here. One of the problems with writing Windows PowerShell code every day is that you eventually... No, it’s not what you think. I am often asked if I run out of ideas, and the answer is, "No, I don’t." There is so much I can do with Windows PowerShell that, in fact, a new version of Windows PowerShell will be out before I ever run out of ideas of what to do with the last version. No, the problem is not that I run out of ideas, but it is that I often fo...

PowerTip: Create New PowerShell Profile for All Hosts
Jul 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Create New PowerShell Profile for All Hosts

Doctor Scripto
Doctor Scripto

Summary: Learn how to create a new Windows PowerShell current user profile for all hosts.  How can I easily create current user profile for all hosts that can be used in the Windows PowerShell console and            the Windows PowerShell ISE?  Use the New-Item cmdlet to create a new file. To find the correct path, use the $profile automatic variable and            choose the CurrentUserAllHosts property, for example: New-Item -ItemType file -Force -Path $PROFILE.CurrentUserAllHosts

Two Cool PowerShell Functions
Jul 24, 2015
Post comments count 0
Post likes count 0

Two Cool PowerShell Functions

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about a pair of cool Windows PowerShell functions to add to your profile. Microsoft Scripting Guy, Ed Wilson, is here. At times, it seems like a Windows PowerShell profile is like a filing cabinet. Whether you have good organizational skills or you organize in a more ad-hoc, random, fashion is a matter of choice—as long as your organization is effective. Today, I want to share a pair of Windows PowerShell functions that are in my Windows PowerShell profile. I believe that I copied them when June Blender and I team-taught a Windows PowerShell class for docum...

PowerTip: Open Windows Explorer to a Location
Jul 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Open Windows Explorer to a Location

Doctor Scripto
Doctor Scripto

Summary: Easily open the Windows Explorer to a specific location in Windows PowerShell.  How can I use Windows PowerShell with the Windows Explorer graphical tool to browse through the files in            my home directory or documents location?  Use the Explorer program name and follow it with the location. For your home directory, use the            $Home automatic variable: explorer $HOME Note  To easily access your documents folder, you can use the variable that I created in            I Have a PowerShell Profile—Now What?: Explorer $doc

Sorting PowerShell Transcript Files
Jul 23, 2015
Post comments count 0
Post likes count 0

Sorting PowerShell Transcript Files

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating a sortable transcript name. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about Windows PowerShell is that if there is something that annoys you, you can generally fix it. Don’t get me wrong, Windows PowerShell is great, but like any program, there are things that annoy me. It is partly because I have different needs than a typical user—I have never been typical in my life. For example, I think that all of the defaults in Windows Explorer are wrong for me. For example, I want to see file extensions, I want to see ...

PowerTip: Determine if Running in PowerShell Console
Jul 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine if Running in PowerShell Console

Doctor Scripto
Doctor Scripto

Summary: Determine if you are running inside the Windows PowerShell console.  How can I find if I am running inside the Windows PowerShell console for my Windows PowerShell profile?  Look at the $host.name property. If it returns ConsoleHost, you are running in the Windows PowerShell console.           The following code shows how to do this: if(($host.Name -match 'consolehost')) {$true}

PowerShell Profile? Which One?
Jul 22, 2015
Post comments count 0
Post likes count 0

PowerShell Profile? Which One?

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about determining which Windows PowerShell profile to use for which functions. Microsoft Scripting Guy, Ed Wilson, is here. Living in central Florida can be a bit warm and humid in late July. Of course, I knew that before we moved here. I told one of my friends recently, when he commented on the heat and humidity, that it was truth in advertising. I told him if the Scripting Wife survived July and August here, she would know that she could handle the worst of the summer weather. Interestingly enough, on many days recently, it has actually been warmer back in Char...

PowerTip: Find Name and Location of PowerShell Profiles
Jul 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Name and Location of PowerShell Profiles

Doctor Scripto
Doctor Scripto

Summary: Learn how to find the name and location of various Windows PowerShell profiles.  How can I find the name and location of various Windows PowerShell profiles?  Use the $profile automatic variable to see what profiles are available for your particular Windows PowerShell           host (for example, the console host or the ISE). To find only the name and the location of the profiles,            you need to return only the properties from the object and then look for names that  begin with A or C,        ...

I Have a PowerShell Profile—Now What?
Jul 21, 2015
Post comments count 0
Post likes count 0

I Have a PowerShell Profile—Now What?

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the what to add into a Windows PowerShell profile. Microsoft Scripting Guy, Ed Wilson, is here. It was a beautiful sunny weekend in central Florida. The Scripting Wife and I headed to Tampa, where we met up with various Windows PowerShell peeps. It is good to get together and talk about cool stuff with cool people. The Microsoft office in Tampa is a really cool place to hang out, and it has awesome views of the harbor. There are also lots of really good restaurants in town. Anyway, when I am around Windows PowerShell people, one of the things I tend to ask ...

PowerTip: Determine If You Have PowerShell Profile
Jul 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine If You Have PowerShell Profile

Doctor Scripto
Doctor Scripto

Summary: Learn how to determine if you have a local Windows PowerShell profile.     How can I find if I have a Windows PowerShell profile?           Use the Test-Path cmdlet, and check for the existence of $profile, for example: test-path $PROFILE

All About PowerShell Profiles
Jul 20, 2015
Post comments count 0
Post likes count 0

All About PowerShell Profiles

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell profiles.  Microsoft Scripting Guy, Ed Wilson, is here. Today I am heading back to the basics. Why? Because my hard disk drive died, and I had to order a new drive to replace it. It gave me a good chance to reinstall Windows 8.1. Now, my laptop is really fast. It is amazing how dramatically the stuff that you install slows down your laptop. Even when you uninstall stuff, most programs leave components behind, so my poor laptop bogs down like a tractor in a muddy field. I didn’t lose any data because I sync everything on a regul...

PowerTip: Find Tangent of 45-Degree Angle with PowerShell
Jul 19, 2015
Post comments count 1
Post likes count 0

PowerTip: Find Tangent of 45-Degree Angle with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Find the tangent of a 45-degree angle with Windows PowerShell.  How can I use Windows PowerShell to obtain the tangent of a 45-degree angle?  Use the Tan static method from the [math] class, for example: [math]::tan(45)

Weekend Scripter: Building Test Servers
Jul 19, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Building Test Servers

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about building test servers. Microsoft Scripting Guy, Ed Wilson, is here. This morning I am listening to my favorite Swiss classical radio station on my computer, and I am sipping a cup of herb tea. I have a nice strawberry scone that I picked up in town at a local bakery. I am reminded of a conversation I had with a friend of mine who was a TAM in Zurich. We were talking about testing changes prior to implementation. In the old days, having a test network meant building racks of servers, restoring tapes, and trying to keep track configurations in sync with produ...

PowerTip: Set Breakpoint Based on Command
Jul 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Set Breakpoint Based on Command

Doctor Scripto
Doctor Scripto

Summary: Learn to set a Windows PowerShell breakpoint based on a specific command.  How can I configure the Windows PowerShell debugger to start when a script hits a specific command?  Use the Set-PSBreakpoint cmdlet and specify a specific command name, for example: Set-PSBreakpoint -Command Foreach

Weekend Scripter: Break in to a Script via a Command
Jul 18, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Break in to a Script via a Command

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using the debugger to break in to a script via a specific command. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things, when troubleshooting a specific function in Windows PowerShell, is to set a breakpoint to occur each time the command is called. Remember, Windows PowerShell functions are also Windows PowerShell commands, just as language statements and cmdlets are. To set the breakpoint in a command, you use the -command parameter. You can break on a call to a Windows PowerShell cmdlet, function, or external script. You can use aliases wh...

PowerTip: Set PowerShell Breakpoint Based on Variable
Jul 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Set PowerShell Breakpoint Based on Variable

Doctor Scripto
Doctor Scripto

Summary: Set a Windows PowerShell breakpoint based on a variable.  How can I enter the Windows PowerShell debugger when a particular variable is accessed in a specific            Windows PowerShell script?  Set a breakpoint and specify a particular variable and script, for example: Set-PSBreakpoint -Variable num -Mode write -Script C:\FSO\BadScript.ps1

Setting a Breakpoint on a Variable
Jul 17, 2015
Post comments count 0
Post likes count 0

Setting a Breakpoint on a Variable

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using variable breakpoints with the Windows PowerShell debugger. Hello Windows PowerShell scripting dudes and dudettes! Debugging Week continues, and today I am talking about using variable breakpoints with the Windows PowerShell debugger. Setting a breakpoint on line 1 of the script is useful for easily entering a debugging session. Setting a breakpoint on a variable can often make a problem with a script easy to detect. This is, of course, especially true when you have already determined that the problem is with a variable that is getting assigned a value...

PowerTip: Find All Disabled Breakpoints in PowerShell
Jul 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find All Disabled Breakpoints in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Find all disabled breakpoints in a Windows PowerShell session.  How can I use Windows PowerShell to see what breakpoints are disabled in my current session?  Use the Get-PSBreakPoint cmdlet, and filter breakpoints that are not enabled, for example: Get-PSBreakpoint | where {-not ($_.enabled)}

Understanding PowerShell Script Debugging
Jul 16, 2015
Post comments count 0
Post likes count 0

Understanding PowerShell Script Debugging

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about understanding Windows PowerShell debugging. Microsoft Scripting Guy, Ed Wilson, is here. Today I am working a little bit on my presentation for the Atlanta TechStravagenza that will be held at the Georgia Tech Research Institute Conference Center in midtown Atlanta on Friday August 21, 2015. It is not going to be held at the Microsoft Office this year, because the event has simply grown too large for the facilities. It will be an absolutely awesome day, and I look forward to seeing Mark Minasi and others who will be there. As Debugging Week continues, I wan...

PowerTip: Find References to Uninitialized Variables in PowerShell
Jul 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Find References to Uninitialized Variables in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Easily find references to uninitialized variables in Windows PowerShell.  My extremely long script keeps failing and I suspect it may be because of variables that are not            initialized prior to being used. How can I find uninitialized variables?  Use the Set-StrictMode cmdlet and set it to –version 1 to ensure that all references to            initialized variables generate an error: Set-StrictMode –version 1

PowerShell Cruise announced
Jul 15, 2015
Post comments count 0
Post likes count 0

PowerShell Cruise announced

mredwilson
mredwilson

SUMMARY: The Windows PowerShell Cruise, PowerShell on the high seas, is announced What's better than a vacation? How's geeking out about PowerShell (and other technologies) with a bunch of MVPs and doing that, in the Bahamas? I'm Doug Finke, 7 time PowerShell MVP and author or "PowerShell for Developers". Earlier this year people in the PowerShell community asked about organizing an all PowerShell event or conference in the Northeast. In thinking about it, I hit on the idea of why not do a conference on a cruise. I told Jeff Langdon, he was one of the people I was in touch with about doing a large event around Po...

Use PowerShell Strict Mode for Debugging
Jul 15, 2015
Post comments count 0
Post likes count 0

Use PowerShell Strict Mode for Debugging

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using strict mode in Windows PowerShell for debugging purposes. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about Windows PowerShell is that it can take being ignored or being used carelessly and sloppily, and it still seems to work fine. I mean, in the old days with VBScript, it was common to use Option Explicit to force you to declare all of the variables that you were going to use in the script. In Windows PowerShell, no one seems to do this…at all. The bad thing is that if I run a script (say in the Windows PowerShell ISE)...

PowerTip: Enable Script Tracing in PowerShell Functions
Jul 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Enable Script Tracing in PowerShell Functions

Doctor Scripto
Doctor Scripto

Summary: Enable script tracing into and out of Windows PowerShell functions.  How can I trace my script execution into and out of Windows PowerShell functions?  Use the Set-PSDebug cmdlet and set a trace level of 2: Set-PSDebug  -Trace 2

More PowerShell Script Tracing and Strict Mode
Jul 14, 2015
Post comments count 0
Post likes count 0

More PowerShell Script Tracing and Strict Mode

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks more about Windows PowerShell script tracing and enabling strict mode. Microsoft Scripting Guy, Ed Wilson, is here. It can be somewhat painful to troubleshoot intermittent errors with Windows PowerShell. Two things that can lead to this are variables that do not get initialized properly (and therefore their values change over subsequent running of the script) and functions that do not get accessed properly. To solve both of these problems, we can use Windows PowerShell cmdlets. Yesterday in Tracing the Execution of a PowerShell Script, I introduced the tracing le...

PowerTip: Use Cmdlet to Trace Script Execution
Jul 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Cmdlet to Trace Script Execution

Doctor Scripto
Doctor Scripto

Summary: Use a Windows PowerShell cmdlet to trace script execution.  How can I trace lines that execute in a Windows PowerShell script, without concern for variable assignments, functions, or external scripts?  Use the Set-PSDebug cmdlet and set a trace level of 1: Set-PSDebug -trace 1

Tracing the Execution of a PowerShell Script
Jul 13, 2015
Post comments count 0
Post likes count 0

Tracing the Execution of a PowerShell Script

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using a cmdlet to trace the execution of a Windows PowerShell script.  Hey, Scripting Guy! I am having a problem with a script. It does not generate any errors, but dude, it does not seem to work either. Can you help me debug it? —DR  Hello DR, Microsoft Scripting Guy, Ed Wilson, is here. When I see a script that doesn’t work, I think, "Cool…it is easy to troubleshoot." Often this is the case because the error message helps locate the source of the error. But if a script simply doesn’t work, it can be more diffic...

PowerTip: Find All Breakpoints in PowerShell Session
Jul 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Find All Breakpoints in PowerShell Session

Doctor Scripto
Doctor Scripto

Summary: Find all breakpoints for a Windows PowerShell script.  How can I see the debugging breakpoints that are set in my current Windows PowerShell session?  Use the Get-PSBreakpoint cmdlet.

Weekend Scripter: Debug, Boss…Debug
Jul 12, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Debug, Boss…Debug

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about debugging Windows PowerShell scripts. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about central Florida is there are lots of farmers markets… especially (I am told) this time of the year. This is great, because I prefer organically grown, locally sourced food. I mean, I like my food to be simply food—not food and a whole lot of additives and other things. My simple rule is this: If I cannot read and pronounce it, then I won’t eat it. Although I have taken many science classes at the university, I have not had a che...

PowerTip: Use PowerShell to Get Disk Drive Overview
Jul 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Disk Drive Overview

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to obtain a disk drive overview.  How can I use Windows PowerShell to get a quick overview of my disk drives?  Open Windows PowerShell with Admin rights, and use the Get-Disk function to retrieve            the disk number, operational status, health status, friendly name, and size, for example: Get-Disk | select number, operation*, health*, friendly*, size

Weekend Scripter: The Big Decision about Scripts
Jul 11, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: The Big Decision about Scripts

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about if you should write Windows PowerShell scripts or do something else. Microsoft Scripting Guy, Ed Wilson, is here. It is the weekend, and once again, it is a beautiful sunny morning in central Florida. I am sitting outside with my Windows Surface Pro 3, and taking the time to do a little writing. I picked up some fresh bagels, and I am sipping a nice cup of English Breakfast tea with a bit of lemon in it. As I reflect back over this week’s blog posts, I think I need to clarify one thing: the whole point of scripting is to make things easier. If it is e...

PowerTip: Use PowerShell to Obtain Unique List of Process Names
Jul 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Obtain Unique List of Process Names

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a list of unique process names.  How can I use Windows PowerShell to obtain a list of all the unique process names running on my system?  Use the Get-Process cmdlet, pipe the results to the Select-Object cmdlet, and specify the Name property and the –Unique switch: Get-Process | select name -Unique

Understanding PowerShell Modules
Jul 10, 2015
Post comments count 0
Post likes count 0

Understanding PowerShell Modules

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell modules.  Hey, Scripting Guy! I keep hearing about Windows PowerShell modules, but I do not know what they really mean. Is it something that comes with Windows PowerShell, or is it something I have to buy or download? I don’t get it. Can you shed some light? —ST  Hello ST, Microsoft Scripting Guy, Ed Wilson, is here. Things are really exciting around the Scripting Household. I have been talking to Microsoft evangelist ,Blain Barton, about doing a PowerShell Saturday in Florida. Without giving any details away, it is ...

PowerTip: Determine Name of PowerShell Host
Jul 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine Name of PowerShell Host

Doctor Scripto
Doctor Scripto

Summary: Learn how to determine the name of the Windows PowerShell host.  How can I find the name of the Windows PowerShell host (such as the Windows PowerShell console or            the Windows PowerShell ISE)?  Use the Get-Host cmdlet and select the Name property: (get-host).name

Understanding Advanced Functions in PowerShell
Jul 9, 2015
Post comments count 0
Post likes count 0

Understanding Advanced Functions in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell advanced functions.  Hey, Scripting Guy! I keep hearing about advanced functions, but to be honest, I am not really sure what they are talking about. I mean, I can do a function, but when does it become advanced? Only when it is really long? Or when it does complicated stuff? I don’t know if I have ever written an advanced function, do you? —BB  Hello BB, Microsoft Scripting Guy, Ed Wilson, is here. Awesome day! I just received my copy of Blain Barton’s new book, Microsoft Public Cloud Services: Setting up your...

PowerTip: Find Status of Range of Services with PowerShell
Jul 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Status of Range of Services with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the status of a range of services.  How can I use Windows PowerShell to find the status of a range of services that have an initial letter that            does not begin with V through Z?  Use Get-Service with the –Exclude parameter, and supply a wildcard character set that represents            the letters V through Z: Get-Service -Exclude [V-Z]*

Fun with PowerShell Functions
Jul 8, 2015
Post comments count 0
Post likes count 0

Fun with PowerShell Functions

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about basic design considerations for Windows PowerShell functions.  Hey, Scripting Guy! I keep hearing about functions, but I really do not know what they are, how to create one, or even how to use one. Can you help me with this? I am not a programmer, but it seems likely that you guys are trying to force me to become one. Help! —DS  Hello DS, Microsoft Scripting Guy, Ed Wilson, is here. It is another beautiful day here in Central Florida. I am sipping a nice cup of Djareerling tea, with a bit of orange blossom local honey, and munching on a hone...

PowerTip: Pick Up User Name with PowerShell
Jul 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Pick Up User Name with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily pick up the user name.  How can I easily pick up the user name from my Windows PowerShell script?  Use the USERNAME environmental variable, and pick it up from the $env Windows PowerShell drive: $env:USERNAME

PowerTip: Use PowerShell to Get Unique List of Process Names
Jul 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Unique List of Process Names

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a list of unique process names.  How can I use Windows PowerShell to obtain a list of all the unique process names running on my system?  Use the Get-Process cmdlet, pipe the results to the Select-Object cmdlet, and specify the Name property            and the –Unique switch: Get-Process | select name -Unique

A PowerShell Script Is…
Jul 7, 2015
Post comments count 0
Post likes count 0

A PowerShell Script Is…

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating and using a Windows PowerShell script. Microsoft Scripting Guy, Ed Wilson, is here. This afternoon, it is raining—actually more like a thunderstorm because there is lightning and thunder. In the afternoon in central Florida, there is a really good chance that for 10 or 15 minutes, one will see an awesome thunderstorm. I think the weather people always have a standard line: "Chance of afternoon thunderstorms"—and there is a good chance they will be right. Anyway, listening to Beethoven and watching a thunderstorm is awesome. I even decid...

PowerTip: Use PowerShell to Display Time in 24-Hour Format
Jul 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display Time in 24-Hour Format

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display the current time in 24-hour format.  How can I use Windows PowerShell to display the current time in 24-hour format?  Use the Get-Date cmdlet and the –UFormat parameter with %R: Get-Date -UFormat %R

PowerShell Scripting: The Terms
Jul 6, 2015
Post comments count 0
Post likes count 0

PowerShell Scripting: The Terms

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about Windows PowerShell scripting terminology.  Hey, Scripting Guy! So I am confused, and I am not afraid to admit that I am confused. In the old fashioned VBScript days, I wrote scripts. I could also write subroutines or functions. And that was about it. Pretty simple, and it made sense to me. But with Windows PowerShell, it seems that there is so much more, and I do not even know where to begin. Not to mention that I have not seen a single reference about how to create a subroutine in Windows PowerShell. What gives? Can you throw me a bone? —JT &nbs...

PowerTip: Get Time with PowerShell
Jul 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Get Time with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get the current time.  How can I use Windows PowerShell to get the current time?  Use the Get-Date cmdlet and specify a –DisplayHint of Time: Get-Date -DisplayHint time

Weekend Scripter: When to Write a PowerShell Script
Jul 5, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: When to Write a PowerShell Script

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about when to write a Windows PowerShell script. Microsoft Scripting Guy, Ed Wilson, is here. I am enjoying a beautiful sunny morning in central Florida. The sun is shining, there is hardly a cloud in the sky, and a gentle ocean breeze tickles my skin. I am sitting outside under a beautiful, several-hundred year-old oak tree with Spanish moss that hangs to the ground from its bent branches. I mean, dude, if ZZ Top had a tree, it would look like this one. Anyway, I am sitting out here with an oversized cup of Darjeeling tea, a plate of freshly sliced locally grown...

PowerTip: Multiply Value in Variable and Store Results
Jul 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Multiply Value in Variable and Store Results

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results. How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable? Use the *= operator, for example:PS C:> $a = 2PS C:> $a *= 3PS C:> $a6

PowerTip: Multiply Value in Variable and Store Results
Jul 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Multiply Value in Variable and Store Results

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results.  How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable?  Use the *= operator, for example: PS C:\> $a = 2 PS C:\> $a *= 3 PS C:\> $a 6

Weekend Scripter: Welcome to the PowerShell Information Stream
Jul 4, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Welcome to the PowerShell Information Stream

Doctor Scripto
Doctor Scripto

Summary: Learn about the Windows PowerShell information stream in this guest post by June Blender. Microsoft Scripting Guy, Ed Wilson, is here. Today we have another guest blog post by Honorary Scripting Guy and Sapien technical evangelist, June Blender. Take it away June... Note  This post is updated on August 3, 2015 for the Windows PowerShell 5.0.10240 preview. A previous version described the information stream features in Windows PowerShell 5.0.10018. This post introduces the new information stream in Windows PowerShell 5.0, and it explains the issue it tries to solve and its elegant solution. In M...

PowerTip: Use PowerShell to Create OU in Active Directory
Jul 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create OU in Active Directory

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily create an organizational unit in Active Directory.  How can I use Windows PowerShell to create a new organizational unit (OU) in Active Directory?  Use the New-ADOrganizationalUnit cmdlet, and specify the name and path. A description is optional.            If you want to easily delete the OU later, set the ProtectedFromAccidentalDeletion flag to false.            Note  The following command is a one-line command that accomplishes this: New-ADOrganizationalUnit -Name Charlotte -...

Use PowerShell to Find Changes to Active Directory
Jul 3, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Find Changes to Active Directory

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find changes to Active Directory.  Hey, Scripting Guy! I have this problem. It seems our company has undergone a lot of changes recently, and I need to find what changes have impacted Active Directory. Basically, I do not even know where to start. I would like to get an overview of what things have changed since a specific date. Is this even possible with Windows PowerShell? —GF  Hello GF, Microsoft Scripting Guy, Ed Wilson, is here. Hey, the weekend is nearly here—at least if you live on the eastern coast o...

PowerTip: Compare Two Objects with PowerShell
Jul 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Compare Two Objects with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to compare two objects to see differences.  How can I use Windows PowerShell to see if a particular property from two objects is the same?  Use the Compare-Object cmdlet, specify the reference object, the object to compare, and            the property you are interested in looking at, for example: Compare-Object -ReferenceObject $d -DifferenceObject $p -Property lockout

Using PowerShell to Check Lockout Threshold for Domains
Jul 2, 2015
Post comments count 0
Post likes count 0

Using PowerShell to Check Lockout Threshold for Domains

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to check the lockout threshold for several domains.  Hey, Scripting Guy! I have several domains in our forest, and it seems that some weasel got in and changed the lockout threshold in some of the child domains. I know we should have turned on auditing, but we did not. What I need right now is a way to find all of the domains that have been changed. —MB  Hello MB, Microsoft Scripting Guy, Ed Wilson, is here. This weekend, there is a battle-of-the-bands going on in downtown Charlotte. I am thinking that the Scripting ...

PowerTip: Use PowerShell to Get Domain Password Policy
Jul 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Domain Password Policy

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get the domain password policy.  How can I use Windows PowerShell to retrieve the default password policy for my domain?  Use the Get-ADDefaultDomainPasswordPolicy cmdlet.

PowerTip: Use PowerShell to Get Domain Password Policy
Jul 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Domain Password Policy

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get the domain password policy.  How can I use Windows PowerShell to retrieve the default password policy for my domain?  Use the Get-ADDefaultDomainPasswordPolicy cmdlet.

Use Windows PowerShell to Configure Domain Password Policy
Jul 1, 2015
Post comments count 0
Post likes count 0

Use Windows PowerShell to Configure Domain Password Policy

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to configure the default domain password policy.  Hey, Scripting Guy! I need some help. I need to get the default domain password policy, but I do not want to mess around with the Group Policy MMC. Instead, I would like to have objects I can use, and then make some decisions based on what I find. Can you help? —JB  Hello JB, Microsoft Scripting Guy, Ed Wilson, is here. The good news is that the temperature today is only 80 degrees Fahrenheit. The bad news is that dew point is about 78, so the resultant relative humid...

PowerTip: Determine What Character a String Starts With
Jun 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine What Character a String Starts With

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine what character a string starts with.  How can I use Windows PowerShell to show me if a string starts with a particular letter (this also needs to be           case sensitive)?  Use the StartsWith method from the String class, and supply the character to the method. It will return            a True or False Boolean value, for example: PS C:\> "string".StartsWith("s") True PS C:\> "string".StartsWith("S") False

Working with Users in Active Directory
Jun 30, 2015
Post comments count 0
Post likes count 0

Working with Users in Active Directory

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about using Windows PowerShell to work with users in Active Directory Domain Services.  Hey, Scripting Guy! We are a rather diversified IT shop, but we have a heavy investment in Microsoft, and particularly in Active Directory. We use it for everything. I need to be able to update user information, but I cannot install anything on my computer. I need something that is basically in the box. How can I do this? —OF  Microsoft Scripting Guy, Ed Wilson, is here. It is becoming rather warm here in central Florida. The other day, the Scripting Wife and I...

PowerTip: Convert All Uppercase String to Lowercase
Jun 29, 2015
Post comments count 1
Post likes count 0

PowerTip: Convert All Uppercase String to Lowercase

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to convert a string to all lowercase characters.  How can I use Windows PowerShell to convert a string that is in all uppercase to all lowercase characters?  Use the ToLower method from the String class: "STRING".ToLower()

Create Users in Active Directory Without Using Module
Jun 29, 2015
Post comments count 0
Post likes count 0

Create Users in Active Directory Without Using Module

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about creating users in Active Directory Domain Services without using a module. Hey, Scripting Guy! In my company, we do a lot of work with Active Directory, and my team is responsible for this. But not all of the administrators have the Active Directory module, so I cannot assume that it will be available when we need to run a script. I need to be able to create users from a script (like I did with VBScript) without having to do anything special. Can this still be done by using Windows PowerShell? —GF Hello GF, Microsoft Scripting Guy, Ed Wilson, is here....

PowerTip: Select Two Random Numbers from 20 Possibilities
Jun 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Select Two Random Numbers from 20 Possibilities

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to select two random numbers from twenty possible numbers.  How can I use Windows PowerShell to select two of twenty attendees at user group to receive prizes?  Create a range of input numbers with the Get-Random cmdlet, then use the –Count parameter to retrieve           two random numbers: Get-Random -InputObject (1..20) -Count 2

Weekend Scripter: Fun with Number Ranges and PowerShell
Jun 28, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Fun with Number Ranges and PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to split arrays of numbers into contiguous ranges. Microsoft Scripting Guy, Ed Wilson, is here. Today I have a cool post from guest blogger, Zachary Loeber. Here is a little bit about Zachary: Zachary Loeber is a solution architect with PSC Group. Zachary is a seasoned network and systems architect and an administrator with hands-on experience for a wide range of technologies including Cisco/Juniper/HP networking, Exchange 2003/2007/2010/2013, Lync 2010/2013, Skype for Business, Active Directory, VMware, Linux, SAN technologies, and Windows PowerShell scripting. Zachary holds seve...

PowerTip: Load All PowerShell Modules at Startup
Jun 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Load All PowerShell Modules at Startup

Doctor Scripto
Doctor Scripto

Summary: Learn how to load all Windows PowerShell modules at startup.  How can I load all of my Windows PowerShell modules when I start the Windows PowerShell console?  In your Windows PowerShell profile, use the Get-Module cmdlet and pipe the results to the            Import-Module cmdlet, for example: Get-Module -ListAvailable | Import-Module

PowerShell Spotlight: Yeah! It’s the Scripting Games
Jun 27, 2015
Post comments count 0
Post likes count 0

PowerShell Spotlight: Yeah! It’s the Scripting Games

Doctor Scripto
Doctor Scripto

Summary: Teresa Wilson, Microsoft PowerShell MVP, introduces the new Scripting Games for 2015. Hello everyone. Teresa Wilson (aka The Scripting Wife) here with this month's PowerShell Spotlight. I am going to spill the beans about the Scripting Games with a little help from Don Jones, Windows PowerShell MVP and president of PowerShell.org. Because I am the treasurer for PowerShell.org, I get to have input occasionally, and I am always ears to the ground when something is going on in the Windows PowerShell community so I can offer assistance as I am able. I am not into reinventing the wheel, so most of this post i...

PowerTip: Use PowerShell to Get Licensed Users in Office 365
Jun 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get Licensed Users in Office 365

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a list of users who are licensed in Office 365.  How can I get a list of all users that are licensed in Office 365?  Use the Get-Msoluser cmdlet from the MSOnline module and filter on the IsLicensed property: Get-Msoluser | Where { $_.Islicensed }

Using Windows PowerShell with Staged Migrations: Part 5
Jun 26, 2015
Post comments count 0
Post likes count 0

Using Windows PowerShell with Staged Migrations: Part 5

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to license users and correct the login ID for Office 365.  Note  This is a five-part series that includes the following posts: Honorary Scripting Guy, Sean Kearney, is here, and we're finishing up our week with Windows PowerShell and staged migrations in Office 365. By this point you’ve done all the dirty work. The user email accounts are up in Office 365 and the on-premise staff is still able to communicate via email while the migration is ongoing. Ah, yes…excellent. A job well done. Well, almost. The Office 365 mailboxes still need t...

PowerTip: Provide Alternate Name to Nouns in Module
Jun 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Provide Alternate Name to Nouns in Module

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to provide alternate names to nouns in modules to avoid conflicts.  How can I use Windows PowerShell to avoid the problem of having conflicting cmdlet names in different modules?  Use the Prefix parameter with Import-Module. Prefix will take whatever letter segment you provide and            add that before the noun in all the cmdlets for a module you load. For example, if I want to make sure all the            cmdlets in the UEV module have HSG before the noun, I would type: Import-Modu...

Using Windows PowerShell with Staged Migrations: Part 4
Jun 25, 2015
Post comments count 0
Post likes count 0

Using Windows PowerShell with Staged Migrations: Part 4

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to convert mailboxes to mail-enabled users in Office 365. Note  This is a five-part series that includes the following posts: Honorary Scripting Guy, Sean Kearney is here. When last we left, you had been shown how to access the reports and statistics from your staged migration from Windows PowerShell. By that point, you would have some mailboxes completed with their data in the cloud. What next? Today we’re stepping into the bits and bytes in Windows PowerShell. For a moment, let’s think about what we really have: two separate and foreign Exchang...

PowerTip: Use Windows PowerShell to Get Migration Statistics
Jun 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Windows PowerShell to Get Migration Statistics

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to pull statistics about user migrations.  How can I use Windows PowerShell to easily display a report with the time and amount of data transferred with            my staged migrations?  Use the Get-MigrationUser and Get-MigrationUserStatistics cmdlets and access some key properties,            for example: Get-MigrationUser | Get-MigrationUserStatistics | Select-Object SyncedItemCount,TotalInprogressDuration,BytesTransferred,AverageBytesTransferredPerHour

Using Windows PowerShell with Staged Migrations: Part 3
Jun 24, 2015
Post comments count 0
Post likes count 0

Using Windows PowerShell with Staged Migrations: Part 3

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to obtain the status and statistics from staged migrations. Note  This is a five-part series that includes the following posts: Honorary Scripting Guy, Sean Kearney, is here. Today we’re going to look into using Windows PowerShell on a deeper level with our staged migrations. That is, we’re going to pull down not only the results of said migrations, but also statistics. When you examine your staged migrations you’ll see simple results such as Synched or Failed. In the following image, you can see the four batches we have done. All of these ...

PowerTip: Use PowerShell to Get List of Migration Batches in Office 365
Jun 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get List of Migration Batches in Office 365

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to identify all migration batches and their status in Office 365.  Rather than navigating the Office 365 console to check the status of a migration, is there an easy way            to do it with Windows PowerShell?  To get list of all migration batches in Office 365 and their status, simply run Get-MigrationBatch.

Using Windows PowerShell with Staged Migrations: Part 2
Jun 23, 2015
Post comments count 0
Post likes count 0

Using Windows PowerShell with Staged Migrations: Part 2

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to upload and start staged migrations. Note  This is a five-part series that includes the following posts: Honorary Scripting Guy, Sean Kearney, is here to get you up and running with staged migrations in Office 365. There are some prerequisites you’ll need, of course: With these in place, you can perform a staged migration. The staged migration builds content in Office 365 by synchronizing selected user mailboxes via Outlook Anywhere. When the synchronization process is complete, it establishes forwarding email from the on-premise Exchange server...

PowerTip: Use PowerShell to List All Domains in Office 365 Subscription
Jun 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to List All Domains in Office 365 Subscription

Doctor Scripto
Doctor Scripto

Summary: Use Windows Powershell and the MSOnline cmdlets to identify all Internet domains attached to an Office 365 subscription.  How can I use Windows PowerShell to easily audit an Office 365 subscription for domains that are attached to it?  Use the Get-MSolDomain cmdlet, and if you want a list in a CSV file for auditing purposes, add            the Export parameter, for example: Get-MsolDomain | Export-CSV o365domains.csv

Using Windows PowerShell with Staged Migrations: Part 1
Jun 22, 2015
Post comments count 0
Post likes count 0

Using Windows PowerShell with Staged Migrations: Part 1

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to add and verify email domains in Office 365. Note  This is a five-part series that includes the following posts: Honorary Scripting Guy, Sean Kearney, is here. This week we’re going to touch on something that should be useful to many IT professionals who are trying to get themselves on to Office 365—that is a staged migration. When you are moving to Office 365, a staged migration is the preferable option if you’re starting from an Exchange Server 2007 or 2003 environment. It allows you to build out mailboxes in Office 365 without really needin...

PowerTip: Use PowerShell to Generate Tenant Site Report
Jun 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Generate Tenant Site Report

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to generate a report about Office 365 tenant sites.  How can I use Windows PowerShell to generate a report about my Office 365 tenant sites?  Install the SharePoint Online Management Shell and install the cmdlet library for SharePoint Online            (provided by MVP, Gary LaPointe). This will give you 82 cmdlets.

Weekend Scripter: Start PowerShell Scripting for Office 365 Sites
Jun 21, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Start PowerShell Scripting for Office 365 Sites

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Michael Blumenthal shows how to findWindows PowerShell cmdlets that are available for Office 365 sites. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a new guest blogger, Michael Blumenthal, who we met in Chicago in May at Microsoft Ignite. Here is a little bit about Michael: Michael Blumenthal is a technical solution evangelist with PSC Group and a Microsoft Office 365 MVP. As such, he is an experienced architect for SharePoint, and business technology advisor. Michael has deep SharePoint expertise, with two decades of development, infrastructure, and administratio...

PowerTip: Use PowerShell to Get Computer Name
Jun 20, 2015
Post comments count 6
Post likes count 0

PowerTip: Use PowerShell to Get Computer Name

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get your computer name.  How can I use Windows PowerShell to easily retrieve my computer name?  Use the environmental variable ComputerName: $env:computername

Weekend Scripter: Understanding Quotation Marks in PowerShell
Jun 20, 2015
Post comments count 0
Post likes count 1

Weekend Scripter: Understanding Quotation Marks in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Don Walker, explores using single and double quotation marks in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Welcome new guest blogger, Don Walker. Don is a coworker of guest blogger, Tim Bolton, and he worked with Tim on a project that Tim blogged about on June 18, 2015, Using PowerShell Grid View for User Info. Here's Don's contact information: Twitter: @EngineeringDon LinkedIn: www.linkedin.com/in/EngineeringDon A while back, I was asked to explain the difference between using single quotation marks ( ‘ ) and double quotation marks ( “ ) to...

PowerTip: Line Continuation in PowerShell
Jun 19, 2015
Post comments count 0
Post likes count 2

PowerTip: Line Continuation in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Ensure a line continuation in Windows PowerShell.  What the line continuation character should use to ensure my Windows PowerShell code            continues to the next line?  The line continuation character in Windows PowerShell is the backtick.            Type a <space>, the backtick, and then press ENTER, for example: Get-Process -Name ` "Powershell_ISE"

PowerShell Code Breaks: Break Line, Not Code
Jun 19, 2015
Post comments count 0
Post likes count 0

PowerShell Code Breaks: Break Line, Not Code

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about line continuation without breaking Windows PowerShell code.  Hey, Scripting Guy! I have a problem sometimes when I copy code from the Hey, Scripting Guy! Blog. It does not seem to work. I try to take out spaces, but it still doesn’t work. I am at my wits end because the code should do exactly what I want it to do, but I cannot get it to work. Can you help me? —BG  Hello BG, Microsoft Scripting Guy, Ed Wilson, is here. It is definitely summer here in Charlotte, North Carolina. When the sun comes up, it is already hot, and when the sun g...

PowerTip: Use PowerShell Grid View to Display Logon Info
Jun 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell Grid View to Display Logon Info

Doctor Scripto
Doctor Scripto

Summary: Learn how to display user logon information.  How can I use Windows PowerShell to display user logon information in an easy graphical manner?  Create two hash tables using environmental variables, and pipe the input to the Out-Gridview cmdlet,            for example: @{"username" = $env:USERNAME}, @{"Computername"=$env:COMPUTERNAME} |Out-GridView -Title "user logon info" Note This is a single-line command broken at the pipeline character for display on the blog.

Using PowerShell Grid View for User Info
Jun 18, 2015
Post comments count 0
Post likes count 0

Using PowerShell Grid View for User Info

Doctor Scripto
Doctor Scripto

Summary: Learn how to use the Windows PowerShell grid view to display user information in this guest post by Tim Bolton and Don Walker. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Tim Bolton... Hi all, This project was a joint effort with my coworker, Don Walker (@EngineeringDon). In my current work environment, the character set used for user IDs that are stored in Active Directory can be a mixed bag of uppercase letters, lowercase letters, or a mix of both. This is due in part to a large Active Directory merger project that is currently underway. Due to that condition and the numero...

PowerTip: Return Specific Number of PowerShell Cmdlets
Jun 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Return Specific Number of PowerShell Cmdlets

Doctor Scripto
Doctor Scripto

Summary: Learn how to return only a specific number of Windows PowerShell cmdlets.  How can I find only four Windows PowerShell cmdlets that use the verb Get, without seeing a            long scrolling list of found cmdlets?  Use the TotalCount parameter of the Get-Command cmdlet, for example: Get-Command -Verb get -TotalCount 4

PowerShell and the Active Directory Schema: Part 2
Jun 17, 2015
Post comments count 3
Post likes count 0

PowerShell and the Active Directory Schema: Part 2

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Andy Schneider, continues his discussion about extending the Active Directory schema. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Andy Schneider, for Part 2 of his series. If you missed yesterday's post, see PowerShell and the Active Directory Schema: Part 1. Yesterday, we looked at what the Active Directory schema is and how to access details of the schema by using Windows PowerShell. In this post, we are going to look at how we can look at the schema, and also update the schema. If you didn’t get a chance to read Extending the Active Directory Sche...

PowerTip: Find Specific PowerShell Cmdlet Help
Jun 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Specific PowerShell Cmdlet Help

Doctor Scripto
Doctor Scripto

Summary: Learn how to find help for a specific Windows PowerShell cmdlet parameter.  How can I find more information about a specific Windows PowerShell parameter that I saw a presenter use?  Use the Get-Help cmdlet, and specify the Windows PowerShell cmdlet and parameter names.            This example returns help about the Raw parameter for the Get-Content cmdlet: get-help get-content -Parameter raw

PowerShell and the Active Directory Schema: Part 1
Jun 16, 2015
Post comments count 0
Post likes count 0

PowerShell and the Active Directory Schema: Part 1

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Andy Schneider, discusses extending the Active Directory schema. Microsoft Scripting Guy, Ed Wilson, is here. We welcome back guest blogger, Andy Schneider. Andy has a two-part blog series that will conclude tomorrow. Andy Schneider is the Identity and Access Management Architect for IT Services at Avanade. His team’s job is to ensure that the right people can access the right things at the right time. Andy is very passionate about automation and the DevOps movement. He is a huge fan of Windows PowerShell, and he has been using it since it was first released as Monad. Andy’s pe...

PowerTip: Read Text File in Raw Mode with PowerShell
Jun 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Read Text File in Raw Mode with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to read a text file in raw mode.  How can I use Windows PowerShell to read a text file as a single line of text, not as an array of strings created by            end-of-line returns?  Use the –Raw parameter with Get-Content. This forces Windows PowerShell to ignore new line characters and            end-of-line returns, and instead, return the contents of the file as one string. Here is an example: Get-Content C:\fso\AnEmptyFile.txt -Raw

PowerShell Custom Type Module
Jun 15, 2015
Post comments count 0
Post likes count 0

PowerShell Custom Type Module

Doctor Scripto
Doctor Scripto

Summary: Create custom types in Windows PowerShell with a free module by Jon Newman. Microsoft Scripting Guy, Ed Wilson, is here. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a guest blogger who was with us in 2011, when he wrote Automate Facebook with a Free PowerShell Module.  My name is Jon Newman, and I’m an old hand at Windows PowerShell. I was on the Windows PowerShell 1.0 team, with Bruce, Jim, and all the rest. My primary responsibility was for pipeline execution and error handling. I started at Microsoft in September 1989 (25 years ago!). I wrote management UI and infrastruc...

PowerTip: Use PowerShell to Parse Delimiters in File
Jun 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Parse Delimiters in File

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to parse file delimiters in a file.  How can I use Windows PowerShell to break out lines in a text file that are delimited by “\”? Here is the file content: PS C:> Get-Content C:fsoAnEmptyFile.txt This is content \mydata\more stuff \addmydata\addmore stuff\evenmore  Use the –Delimiter parameter of the Get-Content cmdlet. Here is an example with the associated output: PS C:> Get-Content C:fsoAnEmptyFile.txt -Delimiter \ This is content \ mydata\ more stuff \ addmydata\ addmore stuff\ evenmore

Weekend Scripter: Deciphering Windows PowerShell Shorthand
Jun 14, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Deciphering Windows PowerShell Shorthand

Doctor Scripto
Doctor Scripto

Summary: Learn how to decipher Windows PowerShell shorthand notation in this guest post written by Tim Warner. Microsoft Scripting Guy, Ed Wilson, is here. Welcome a new guest blogger today, Timothy Warner. Tim is an author and evangelist for Pluralsight, a premier online IT pro and development training company. Tim is the author of Sams Teach Yourself Windows PowerShell in 24 Hours, a contributor at PowerShell.org, and a member of the Nashville PowerShell User Group. Hi everyone. When I attended the Microsoft Ignite Conference in Chicago last week, I was somewhat surprised by the amount of Windows PowerShell sho...

PowerTip: Find All PowerShell Cmdlets Except…
Jun 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Find All PowerShell Cmdlets Except…

Doctor Scripto
Doctor Scripto

Summary: Learn how to find all Windows PowerShell cmdlets except those from a specific module.  How can I find all Windows PowerShell cmdlets that begin with the verb "get" but are not contained in the            Windows PowerShell module named “PowerShellCookbook”?  Use the Get-Command cmdlet, and use the Where method to filter that the module name does not equal            “PowerShellCookbook”: (Get-Command -Verb get).where({$_.modulename -ne 'powershellcookbook'})

Weekend Scripter: Jacksonville IT Pro Camp Is Here
Jun 13, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Jacksonville IT Pro Camp Is Here

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the Jacksonville IT Pro Camp. Microsoft Scripting Guy, Ed Wilson, is here. This is a day I have been looking forward to for some time—and now it is here. It is time for the Jacksonville IT Pro Camp. Teresa (aka The Scripting Wife) and I are keynoting the event. That is right. You will get a chance to hear her speak for a change. We will be talking about the importance of community and getting involved in community. It will be awesome. I am also presenting two sessions. I will be doing the Data Grooming session that I presented at the Windows PowerShel...

PowerTip: Display Graphical PowerShell Help​
Jun 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Graphical PowerShell Help​

Doctor Scripto
Doctor Scripto

Summary: Learn how to display graphical Windows PowerShell Help.  How can I see Windows PowerShell Help in a graphical way so I can float the Help?  Use the –ShowWindow parameter from the Get-Help cmdlet, for example: Get-Help Get-Process -ShowWindow

Five Best PowerShell Cmdlets
Jun 12, 2015
Post comments count 0
Post likes count 0

Five Best PowerShell Cmdlets

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the five best Windows PowerShell cmdlets. Microsoft Scripting Guy, Ed Wilson, is here. OK, I will admit that this post is completely arbitrary. What do I mean when I talk about the five best Windows PowerShell cmdlets (commands)? Well, I am thinking about the cmdlets I use on a daily basis and the cmdlets that make my life really easy. The best cmdlet: Get-Command For me, the best Windows PowerShell cmdlet is probably Get-Command. I use this cmdlet every single day. In fact, I often use it multiple times a day. Why? Because I simply cannot remember thousand...

PowerTip: Read NTFS File System Stream with PowerShell
Jun 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Read NTFS File System Stream with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to read a specific NTFS file system stream.  How can I use Windows PowerShell to read a specific NTFS file system stream?  Use the Get-Content cmdlet and specify the name of the file and the name of the stream.            This example reads a stream named Data: Get-Content C:\fso\AnEmptyFile.txt -Stream data

Table of Basic PowerShell Commands
Jun 11, 2015
Post comments count 2
Post likes count 10

Table of Basic PowerShell Commands

Doctor Scripto
Doctor Scripto

PowerTip: Use PowerShell to Add Content to File Stream
Jun 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Add Content to File Stream

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to add content to the file system stream of a file.  How can I use Windows PowerShell to add data to an alternate NTFS file system stream of a file?  Use the Add-Content cmdlet and specify the name of the stream for the Stream parameter,            then specify the data in the –Value parameter, for example: Add-Content C:\fso\AnEmptyFile.txt -Stream Data -Value "datastream" Note  If the stream does not exist, Windows PowerShell creates it. 

Help: It Says Run a PowerShell Script
Jun 10, 2015
Post comments count 0
Post likes count 0

Help: It Says Run a PowerShell Script

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about running a Windows PowerShell script. Microsoft Scripting Guy, Ed Wilson, is here. Ninety two degrees Fahrenheit and sunny—that is what the weather is supposed to be this Saturday in Jacksonville when Teresa and I will be speaking at the Jacksonville IT Pro Camp. I can’t think of a better way to spend a sunny day in Jacksonville, Florida than in a building with the air conditioning on high, and talking about the way cool stuff in Windows PowerShell. Well, maybe I could think of one or two other things to do, but certainly, IT Pro Camp is at the t...

PowerTip: Convert to Decimals and Display Unicode Characters
Jun 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Convert to Decimals and Display Unicode Characters

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to convert hexadecimal values to decimal and display Unicode characters.  I found a cool Unicode table on the Internet, but all of the values are displayed as hexadecimal values.            How can I use Windows PowerShell to translate them to integers and display the Unicode characters?  Use the [Convert] class, call the ToInt32 method, specify the value and 16, and call the [char] class so you            can convert the character to its Unicode character, for example: PS C:\> [c...

Help! It Says PowerShell…Now What?
Jun 9, 2015
Post comments count 0
Post likes count 0

Help! It Says PowerShell…Now What?

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about how to run a Windows PowerShell command.  Hey, Scripting Guy! Help! I am reading through TechNet, and I found this command that seems like it will solve my problem, but I do not know how to do it. It says something about Windows PowerShell, but I do not know what that is, or how to run the command. I opened the command prompt, but all it did was give me errors. So where do I type the command? —WB  Hello WB, Microsoft Scripting Guy, Ed Wilson, is here. One of the bad things about working at Microsoft, is that time sort of becomes skewed. By t...

PowerTip: Use PowerShell to Add Content to File
Jun 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Add Content to File

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to add content to a file.  How can I use Windows PowerShell to add content to a file?  Use the Add-Content cmdlet, and specify the path to the file and the value of the content, for example: Add-Content C:\fso\AnEmptyFile.txt -Value "This is content"

Find PowerShell Reference Documentation
Jun 8, 2015
Post comments count 0
Post likes count 0

Find PowerShell Reference Documentation

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about where to find Windows PowerShell reference documentation. Microsoft Scripting Guy, Ed Wilson, is here. I am eagerly anticipating Saturday because Saturday is the Jacksonville IT Pro Camp, and the Scripting Wife and I will be speaking. I believe there are still tickets available, so if you are in the area, you should definitely check it out. It will be an awesome time. In addition to giving the Keynote, I think I am doing two additional sessions. It will be tremendous fun. The last time we were down there (a couple of years ago), we got to see some friends w...

PowerTip: Use PowerShell to Create New File
Jun 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Create New File

Doctor Scripto
Doctor Scripto

Summary: Create a new file with Windows PowerShell.  How can I use Windows PowerShell to create a new text file that will be empty until I add content?  Use the New-Item cmdlet and specify a path, name, and type, for example: New-Item c:\fso\AnEmptyFile.txt -ItemType file

Weekend Scripter: Best PowerShell Resources on the Web
Jun 7, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Best PowerShell Resources on the Web

Doctor Scripto
Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about the best fundamental resources on the web for Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about the Microsoft Ignite conference in Chicago was getting to see and talk with so many people. Previously, there was a core group of people who went to TechEd and a core group of people who went to MEC, but there were not many people who went to both. As a result, groups were pigeon-holed. By combining the conferences into one giant conference, we were able to see, talk to, and meet people that otherwise would not be in o...

PowerTip: Find Which PowerShell Cmdlets Contain Specific Parameter
Jun 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Which PowerShell Cmdlets Contain Specific Parameter

Doctor Scripto
Doctor Scripto

Summary: Find which Windows PowerShell cmdlets contain a specific parameter.  How can I find which cmdlets contain the –Force parameter?  Use the Get-Command cmdlet and specify the parameter name, for example: Get-Command -ParameterName force

Weekend Scripter: Find Coolest PowerShell Parameter Names
Jun 6, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Find Coolest PowerShell Parameter Names

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about finding the coolest Windows PowerShell parameter names. Microsoft Scripting Guy, Ed Wilson, is here. This morning, my friend and colleague, Dr. Thomas Shinder, posted on Facebook that his favorite Windows PowerShell parameter name is –NoClobber. Interestingly enough, when I was writing my Windows PowerShell Step by Step book, one of the editors suggested that I change –NoClobber to something else. I had to tell her that I could not change it because it was actually part of the code. So what are the parameters that are used by Windows PowerShell ...

PowerTip: Get List of Scheduled Job Results in Azure Automation
Jun 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Get List of Scheduled Job Results in Azure Automation

Doctor Scripto
Doctor Scripto

Summary: Use Azure cmdlets to audit for scheduled job results in Azure Automation.  How can I use Windows PowerShell to view the results of my scheduled runbooks in Azure Automation?  Use the Get-AzureAutomationJob cmdlet from the Azure PowerShell module. For example, to see the results            of all jobs in the 'HSG-AzureAutomation' instance, type: Get-AzureAutomationJob –automationAccountname 'HSG-AzureAutomation'

Using Azure Automation: Part 5
Jun 5, 2015
Post comments count 0
Post likes count 0

Using Azure Automation: Part 5

Doctor Scripto
Doctor Scripto

Summary: Schedule an Azure Automation runbook to get Azure to work for you. Honorary Scripting Guy, Sean Kearney, is here to show you the most importance piece of Azure Automation: the actual scheduling of runbooks to allow you to let Azure do all the automation for you! This is the final post in a five-part series. To catch up, read:  Yesterday, we finished our script to power down the virtual machines in Microsoft Azure, including sending some output to indicate the status of the shutdown. If we go back into our runbook, things look a little different now. Instead of defaulting to the draft editing w...

PowerTip: Start Azure Automation Job from PowerShell
Jun 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Start Azure Automation Job from PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Azure PowerShell cmdlets to launch a remote Azure Automation job.  How can I trigger an Azure Automation job from a regular computer?  Use the Start-AzureAutomationRunbook cmdlet. For example, to trigger the runbook called            HSG-StopAzureVM that is attached to the HSG-AzureAutomation instance, run: Start-AzureAutomationRunbook -Name HSG-ShutdownAzureVM -AutomationAccountName HSG-AzureAutomation

Using Azure Automation: Part 4
Jun 4, 2015
Post comments count 0
Post likes count 0

Using Azure Automation: Part 4

Doctor Scripto
Doctor Scripto

Summary: Learn how to report output from Azure Automation and publish to production. Honorary Scripting Guy, Sean Kearney, is here again to show you more about Azure Automation and to empower you in automating your assets in Azure. This is the fourth post in a five-part series. To catch up, read: Our current task is trying to see what is happening in the magic genie bottle that contains our Azure Automation runbook. I say "magic genie bottle" because up to this point, we really can't see what's going on, can we? There's no Windows Powershell console, no ISE. Nothing… Not a sau...

PowerTip: Show Runbooks in Azure Automation Instance
Jun 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Show Runbooks in Azure Automation Instance

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to show available runbooks in an Azure Automation instance.  How can I use Windows PowerShell to show which runbooks are available in an Azure Automation instance?  Use the Get-AzureAutomationRunbook cmdlet from the Azure module. For example,            to get the runbooks in the 'HSG-AzureAutomation' instance, type: Get-AzureAutomationRunbook –AutomationAccountName 'HSG-AzureAutomation'

Using Azure Automation: Part 3
Jun 3, 2015
Post comments count 0
Post likes count 0

Using Azure Automation: Part 3

Doctor Scripto
Doctor Scripto

Summary: Learn how to access Azure Automation assets within a runbook. Honorary Scripting Guy, Sean Kearney, is here today to battle robots, aliens, and… …No, wait, sorry. My brain lapsed from watching an old rerun of Lost in Space. This is the third post in a five-part series. To catch up, read: Today I will continue showing you how to get up and running with Azure Automation with a simple project of having a runbook to shutdown virtual machines in Azure. Our previous runbook with the fully exposed credentials and a clear-text password looked like this (I sense far too many security specialists...

PowerTip: Show Available Credentials for Azure Automation
Jun 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Show Available Credentials for Azure Automation

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a list of available assets of the Credential type in Azure Automation.  How can I use Windows PowerShell to quickly audit an Azure Automation instance for any credentials that            might be there?  Use the Get-AzureAutomationCredential cmdlet and provide the name of the Azure Automation account,            for example: Get-AzureAutomationCredential –AutomationAccountName 'HSG-AzureAutomation'

Using Azure Automation: Part 2
Jun 2, 2015
Post comments count 0
Post likes count 0

Using Azure Automation: Part 2

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney discusses how to get started and test a basic runbook with Azure Automation. Honorary Scripting Guy, Sean Kearney, is here. Today I'm going to show you the basics you're going to need to make a useful runbook (or Windows PowerShell workflow, if that makes it easier to remember) in Microsoft Azure. This is the second post in a five-part series. Be sure to read Using Azure Automation: Part 1 first. I've started a very basic script block to get a list of virtual machines in Azure and stop them all. Nothing fancy. If I want to, I can click the Test bu...

PowerTip: Show Available Azure Automation Accounts
Jun 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Show Available Azure Automation Accounts

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a list of available Azure Automation accounts.  How can I use Windows PowerShell to see my Azure Automation accounts?  You can get this information with one simple cmdlet: Get-AzureAutomationAccount

Using Azure Automation: Part 1
Jun 1, 2015
Post comments count 0
Post likes count 0

Using Azure Automation: Part 1

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney discusses how to get started with Windows PowerShell and Azure Automation. Honorary Scripting Guy, Sean Kearney, is here, and for the next five days we're going to touch on Azure Automation, which is a great way to automate control of your Azure resources without Internet access. Azure Automation is, when you get right down to it, a way to schedule Windows PowerShell workflows in the cloud. "But wait!" you'll say. "If I want to do that, I can just as easily spin up a virtual machine in Azure and use the scheduled tasks in Windows Server 2...

Weekend Scripter: What to Include in a PowerShell Comment Block
May 31, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: What to Include in a PowerShell Comment Block

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about what to include in a Windows PowerShell comment block. Microsoft Scripting Guy, Ed Wilson, is here. Something that tends to confuse new scripters, regardless of the language, is what to include in a comment block at the beginning of a script. I have reviewed thousands of scripts for various scripters, and I have seen lots of variation. This variation ranges from nothing at all, no comments, not a thing to nearly complete books that describe everything a script should do, might do, and even ways to improve the script should it come time for revision. In real...

PowerTip: Maintain PowerShell Objects
May 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Maintain PowerShell Objects

Doctor Scripto
Doctor Scripto

Summary: Maintain Windows PowerShell objects in the pipeline.  How can I send output to the Windows PowerShell pipeline without changing the formatting or objects, plus            insure that the output go to the Windows PowerShell console if there is nothing else in the pipeline?  The Write-Output cmdlet sends output to the pipeline or to the console if it is the last command in the pipeline: Get-Process | Write-Output

PowerShell Spotlight: Two PowerShell Events
May 30, 2015
Post comments count 0
Post likes count 0

PowerShell Spotlight: Two PowerShell Events

Doctor Scripto
Doctor Scripto

Summary: Windows PowerShell MVP, Teresa Wilson, talks about two upcoming Windows PowerShell community events. Microsoft Scripting Guy, Ed Wilson, is here. Today is the last Saturday of May, and therefore, it is PowerShell Spotlight day with MVP, Teresa Wilson... Happy scripting Saturday, everyone. Today our Windows PowerShell Spotlight is on two events coming up in the next two weeks. First is the Cincinnati PowerShell User Group meeting on June 3. Ed will be the guest speaker at this event. I will be in the audience. For signup, time, and place information (and lots more, see at CincyPowerShell. The main informa...

PowerTip:  Use PowerShell to Display Current Time
May 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display Current Time

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to display the current time.  How can I use Windows PowerShell to display the current time on my computer?  Use the Get-Date cmdlet and tell it to show only the time, for example: Get-Date -DisplayHint Time

PowerShell Time Sync: Orchestrate Monitoring of Remote Servers
May 29, 2015
Post comments count 0
Post likes count 0

PowerShell Time Sync: Orchestrate Monitoring of Remote Servers

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Rudolf Vesely discusses how to monitor remote servers. Microsoft Scripting Guy, Ed Wilson, is here. Today is Part 3 of a 3-part series by guest blogger, Rudolf Vesely. To read the first 2 posts in this series, please see: In previous posts, I described my Time Sync module. I explained how to handle exceptions in parallel operations and how the Start-VSystemTimeSynchronization and Wait-VSystemTimeSynchronization workflows work. Those who have followed along may realize that there are two more workflows in the module. Get current time from the Internet      The f...

PowerTip: Force Time Resync with PowerShell
May 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Force Time Resync with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to force a time resynchronization.  How can I use Windows PowerShell to force a time resynchronization?  Use the W32tm /resync /force command.            Note This command requires elevated rights.

PowerShell Time Sync: Error Handling in Parallel in Workflows
May 28, 2015
Post comments count 0
Post likes count 0

PowerShell Time Sync: Error Handling in Parallel in Workflows

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Rudolf Vesely talks about error handling in workflows and repair actions. Microsoft Scripting Guy, Ed Wilson, is here. Today is Part 2 of a 3-part series written by guest blogger Rudolf Vesely. Read yesterday’s post to catch up and to learn more about Rudolf: PowerShell Time Sync: Get and Evaluate Synchronization State. Take it away, Rudolf... Yesterday, I described the Time Sync module and I explained how the main inline script works. Those of you who checked my source code may realize that I used special error handling for the whole inline script (I do not mean error handling insid...

PowerTip: Use PowerShell to Find Time Service Status
May 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Time Service Status

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find the status of the time service.  How can I use Windows PowerShell to find the status of the time service on my local computer?  If all you are looking for is the status, use the W32tm command with the /query and /status switches: w32tm /query /status

PowerShell Time Sync: Get and Evaluate Synchronization State
May 27, 2015
Post comments count 0
Post likes count 0

PowerShell Time Sync: Get and Evaluate Synchronization State

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Rudolf Vesely, shows how to evaluate time synchronization. Microsoft Scripting Guy, Ed Wilson, is here. Today is day 1 of a 3-part series by Rudolf Vesely. Here, Rudolf tells us about himself: I work as a lead cloud architect in Tieto Productivity Cloud (TPC) at Tieto Corporation. I am a blogger on the Technology Stronghold blog, and I am the author of large series of articles called How to Build Microsoft Private Cloud. I started my career in IT as a developer (assembler, object-oriented programming, C++, C#, .NET, and ASP.NET). However, I moved to operations many years ago. Program...

PowerTip: Pad String to Left with PowerShell
May 26, 2015
Post comments count 0
Post likes count 1

PowerTip: Pad String to Left with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to pad a string to the left.  How can I use a specific Unicode character with Windows PowerShell to pad a string to the left so that the entire            string is a certain length?  Use the PadLeft method from the String class. Specify the length of the newly created string and the Unicode            character as the second parameter. Here is an example that uses a triangle as the pad character. The string is            6 characters long, and the newly created s...

PowerShell and BitLocker: Part 2
May 26, 2015
Post comments count 0
Post likes count 0

PowerShell and BitLocker: Part 2

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Stephane van Gulick, continues his series about using Windows PowerShell and BitLocker together. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back Stephane van Gulick for the final part of his two-part series. Be sure you read PowerShell and BitLocker: Part 1 first. Encryption operations A lot of the following script examples come from a function I wrote called BitLockerSAK. It is a tool written in Windows PowerShell that makes BitLocker tasks easier to automate. Finally, we arrive at the interesting part: the encryption of the drive. Don’t get me wrong—the Trusted Plat...

PowerTip: Determine Letter a String Begins With
May 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine Letter a String Begins With

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine the letter that a string begins with.  How can I use Windows PowerShell to find if a particular string begins with the letter “s”?  Use the StartsWith method from the string, for example: PS C:\> "string".StartsWith("S") False PS C:\> "string".StartsWith("s") True Note The StartsWith method is case sensitive. Therefore “S” does not match the example, but “s” does.

PowerShell and BitLocker: Part 1
May 25, 2015
Post comments count 0
Post likes count 0

PowerShell and BitLocker: Part 1

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Stephane van Gulick, presents a practical hands-on post that shows how to use Windows PowerShell and BitLocker together. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a new guest blogger, Stephane van Gulick. Stephane was introduced to me by The Scripting Wife, she was browsing the Internet and found his blog. She thought he would be an excellent guest for the Hey, Scripting Guy! Blog, and I totally agreed. This is be a two-part blog series and there is a lot of information to share. Here is where you can find Stephane: Website: PowerShell DistrictTwitter : @Stephane...

PowerTip: Find Formatting Information for List Views
May 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Formatting Information for List Views

Doctor Scripto
Doctor Scripto

Summary: Find Windows PowerShell formatting information for list views.  How can I use Windows PowerShell to find information about format data for types for list views?  Use the Get-FormatData cmdlet and pipe the output to Where-Object., for example: Get-FormatData | ? FormatViewDefinition -Match 'list view'

Weekend Scripter: Use PowerShell for JIT Administration and PAM – Part 2
May 24, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell for JIT Administration and PAM – Part 2

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, and Microsoft PFE Ian Farr, continues his series about JIT administration with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today, welcome back Ian Farr for the conclusion of his two-part blog. Before you dig into today's post, please read Use PowerShell for JIT Administration and PAM – Part 1. To read more of Ian's previous guest posts, see these Hey, Scripting Guy! Blog posts. Yesterday, I discussed an advanced function that was written with my teammate, Phil Lane. The function grants membership of a high-privileged group for a defined period of time. ...

PowerTip: Identify Regions in Azure
May 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Identify Regions in Azure

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a current list of regions in Azure.  How can I use Windows PowerShell to show me a list of the regions in Microsoft Azure?  Use the Get-AzureLocation cmdlet to output the list to your screen, then you can filter with            the DisplayName parameter. This example lists all of the U.S. regions: Get-AzureLocation | Where { $_.Displayname –match 'US' } | Format-Table

Weekend Scripter: Use PowerShell for JIT Administration and PAM – Part 1
May 23, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell for JIT Administration and PAM – Part 1

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Microsoft PFE, Ian Farr, talks about JIT administration with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger Ian Farr. To read more of Ian's previous guest posts, see these Hey, Scripting Guy! Blog posts. This weekend is a two-part blog, with today being Part 1. Here's Ian... You may be asking yourself, "What’s JIT administration, and who’s PAM?" Let me explain… The JIT stands for "just-in-time"—and not Just-in-Timberlake, as my colleague, Phil Lane, likes to insist! With Ed’s permissio...

PowerTip: See Data in Azure Storage
May 22, 2015
Post comments count 0
Post likes count 0

PowerTip: See Data in Azure Storage

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to show the files in an Azure Storage blob.  How can I use Windows PowerShell to see files that are in my subscription and stored in Azure blobs?  Use a combination of the Get-AzureStorageContainer and Get-AzureStorageBlob cmdlets.            For example, to see all of the data stored within the VHDs container in an Azure Storage blob, use: Get-AzureStorageContainer vhds | Get-AzureStorageBlob

Use PowerShell to Create Virtual Machine in Azure – Part 5
May 22, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Virtual Machine in Azure – Part 5

Doctor Scripto
Doctor Scripto

Summary: Learn how to create a virtual machine in Azure by using your own VHD template. Honorary Scripting Guy, Sean Kearney is here with the last bit of coolness about creating virtual machines in Azure—using a customized template. This post is part of a series. To catch up, read: Your first challenge is to create a custom virtual machine, which really isn't a challenge. Let's imagine you've got a machine that's set up just the way you want it. Life is good and you're ready to rock. The first thing you'll want to do is make a backup copy of the operating system VHD. If the virtual machine name i...

PowerTip: Identify Extensions in Azure
May 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Identify Extensions in Azure

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a current list of virtual machine extensions in Azure.  How can I find all the extensions that are available for virtual machines in Azure?  To see all the extensions for a virtual machine in Azure, type: Get-AzureVMAvailableExtension | Format-Table

Use PowerShell to Create Virtual Machine in Azure – Part 4
May 21, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Virtual Machine in Azure – Part 4

Doctor Scripto
Doctor Scripto

Summary: Learn how to leverage Desired State Configuration with a virtual machine in Microsoft Azure. Honorary Scripting Guy, Sean Kearney, here today filling in for my buddy Ed. Today I'll show you how to leverage Desired State Configuration (DSC) with a virtual machine in Microsoft Azure. This post is part of a series. To catch up, read: If you didn't already know, Windows PowerShell 4.0 introduced a great new feature called Desired State Configuration, which allows you to define and enforce the features that a server requires. Here is a simple example we will be using to define a very basic web s...

PowerTip: Identify Azure Subscriptions
May 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Identify Azure Subscriptions

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a current list of Azure subscriptions.  How can I use Windows PowerShell to show me a list of the subscriptions that are attached to my Azure account?  Use the Get-AzureSubscription cmdlet.

Use PowerShell to Create Virtual Machine in Azure – Part 3
May 20, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Virtual Machine in Azure – Part 3

Doctor Scripto
Doctor Scripto

Summary: Learn how to spin up a virtual machine in Microsoft Azure. Honorary Scripting Guy, Sean Kearney is here. Ed is still resting nicely, so today, I'll show you how to spin up a virtual machine in Microsoft Azure! If you add Get-Help against the New-AzureVM cmdlet, you'll have an example like this one: New-AzureVMConfig -Name "MyNewVM" -InstanceSize ExtraSmall -ImageName (Get-AzureVMImage)[4].ImageName | Add-AzureProvisioningConfig -Windows -Password $adminPassword -AdminUsername PsTestAdmin | New-AzureVM -ServiceName "MySvc2" -AffinityGroup "Contoso" -WaitForBoot Let's break this down. The first part is the...

PowerTip: Identify Azure Services in Subscription
May 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Identify Azure Services in Subscription

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to get a current list of Azure services in a subscription.  How can I use Windows PowerShell to show me a list of the Azure services in a subscription?  Run the Get-AzureService cmdlet.

Use PowerShell to Create Virtual Machine in Azure – Part 2
May 19, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Virtual Machine in Azure – Part 2

Doctor Scripto
Doctor Scripto

Summary: Learn how to work with sizing names in Microsoft Azure. Honorary Scripting Guy, Sean Kearney, is back again to show more really cool stuff in Microsoft Azure. Be sure to also read Use PowerShell to Create Virtual Machine in Azure – Part 1. When you're creating a virtual machine, you need to specify its size. In Hyper-V or other virtualization solutions, you would normally specify parameters such as: In Microsoft Azure, when you're creating a virtual machine, you actually have a series of prepackaged configurations. These are accessed with the Get-AzureRoleSize cmdlet. If you'd l...

PowerTip: Find the PowerShell Version
May 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Find the PowerShell Version

Doctor Scripto
Doctor Scripto

Summary: Easily find your Windows PowerShell version.  How can I find information about my Windows PowerShell version?  Use the $psversionTable automatic variable with the PSVersion property, for example: $PSVersionTable.PSVersion.Major

Use PowerShell to Create Virtual Machine in Azure – Part 1
May 18, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Create Virtual Machine in Azure – Part 1

Doctor Scripto
Doctor Scripto

Summary: Learn how to use the Azure PowerShell cmdlets to identify built-in virtual machine templates. Honorary Scripting Guy, Sean Kearney, is here today to help out and give Ed a break (enjoy some tea and rest your fingers, my friend). In November, I touched on how to use Windows PowerShell for some overall setup and management of the Azure infrastructure-as-a-service (IaaS). (If you'd like to read more, see this series of Hey, Scripting Guy! Blog posts: Manage Azure IaaS with Windows PowerShell.) Today, I'm going to specifically focus on creating those virtual machines and all you'll need to kno...

PowerTip: Find PowerShell Aliases by Module
May 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Aliases by Module

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find aliases by module.  How can I easily find which modules expose aliases?  Use the Get-Alias cmdlet and pipe the results to the Sort-Object cmdlet (Sort is an alias), for example: Get-Alias | sort modulename -Descending

Weekend Scripter: Manage SQL Server Virtual Log File with PowerShell
May 17, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Manage SQL Server Virtual Log File with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Microsoft PFE, Jonathan Yong, talks about using Windows PowerShell to manage the SQL Server virtual log file. Microsoft Scripting Guy, Ed Wilson, is here. This is the week of new guest bloggers it seems. Today, please welcome Microsoft PFE, Jonathan Yong... Some time back, I was discussing a SQL Server administration use case with another engineer. The customer’s DBA wanted to get a list of all virtual log files for each database in the instance to decide which database’s log file needed tuning. The easy part is that DBCC LOGINFO will provide this information. The tricky part i...

PowerTip: Find Aliases for PowerShell Cmdlets
May 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Aliases for PowerShell Cmdlets

Doctor Scripto
Doctor Scripto

Summary: Learn how to find aliases for Windows PowerShell cmdlets.  How can I easily find all the aliases defined for a given Windows PowerShell cmdlet?  Use the –Definition parameter of the Get-Alias cmdlet, for example: Get-Alias -Definition Get-ChildItem

Weekend Scripter: Get Started with PowerShell for Amazon Web Services
May 16, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Get Started with PowerShell for Amazon Web Services

Doctor Scripto
Doctor Scripto

Summary: Windows PowerShell MVP, Mike F Robbins, walks through a setup to manage an Amazon Web Services environment with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back Mike F Robbins to talk about Windows PowerShell for Amazon Web Services. Mike F Robbins is a Microsoft MVP for Windows PowerShell and for SAPIEN Technologies. He is a co-author of Windows PowerShell TFM 4th Edition, and he is the contributing author of a chapter in PowerShell Deep Dives. Mike has written guest posts for PowerShell Magazine, PowerShell.org, and the Hey, Scripting Guy! Blog (to read more of Mike...

PowerTip: Update Windows PowerShell Help Files
May 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Update Windows PowerShell Help Files

Doctor Scripto
Doctor Scripto

Summary: Learn to easily update Windows PowerShell Help files.  I try to use Get-Help, but I am unable to retrieve any information. What do I need to do?  Open the Windows PowerShell console (or the Windows PowerShell ISE) with admin rights, and            type Update-Help.

Let Sleeping VBScript Scripts Lie
May 15, 2015
Post comments count 0
Post likes count 0

Let Sleeping VBScript Scripts Lie

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about when to replace a VBScript script and when not to. Microsoft Scripting Guy, Ed Wilson, is here. One of the really awesome things about the Microsoft Ignite conference in Chicago this year was the chance to talk to literally thousands of people who stopped by the Scripting Guys booth on the Expo floor. One of the things that surprised me was the number of people who apologized—actually apologized—for still running VBScript. They would say something like, “We still run lots of VBScript in our environment.” OK… Let me make this o...

PowerTip: Find Approved Verbs in PowerShell
May 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Approved Verbs in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find approved verbs.  How can find a list of approved verbs for a function I am writing in Windows PowerShell?  Use the Get-Verb function.

Use PowerShell to Check In for Flight
May 14, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Check In for Flight

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Microsoft PFE, Bill Grauer, talks about using Windows PowerShell to check in for a flight. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a new guest blogger—Bill Grauer, a Microsoft PFE... As a Windows PowerShell instructor, I try to drive home a simple point to my students, whether they are absolute beginners or more seasoned scripters. Becoming proficient in a language, whether it be Spanish or Windows PowerShell, requires practice. This means finding every opportunity you can to accomplish some task you're currently doing manually, and automating it.  These ...

PowerTip: Test URI with PowerShell
May 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Test URI with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to test a URI.  How can I use Windows PowerShell to easily test if I can reach a URI?  Use the Test-Uri function from the Windows PowerShell Cookbook module, for example: Test-Uri -Uri http://www.microsoft.com  

Use Windows PowerShell to Parse RSS Feeds
May 13, 2015
Post comments count 0
Post likes count 0

Use Windows PowerShell to Parse RSS Feeds

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Will Anderson, talks about using Windows PowerShell to parse RSS feeds. Microsoft Scripting Guy, Ed Wilson, is here. Today I welcome recent Windows PowerShell MVP and new guest blogger, Will Anderson... Hi there fellow scripters! Last week as I took my seat on a connecting flight in New York from beautiful Charlotte, North Carolina, my thoughts drifted to the wonderful experiences and memories that I took with me from the Windows PowerShell Summit. One thought in particular crossed my mind. It was a challenge posed to me by a member of the Windows PowerShell team. “Will,&r...

PowerTip: Convert PowerShell Path to Standard Path
May 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Convert PowerShell Path to Standard Path

Doctor Scripto
Doctor Scripto

Summary: Convert a Windows PowerShell path to a standard path.  How can I convert a Windows PowerShell registry provider path to a standard registry path?  Use the Convert-Path cmdlet, for example: Convert-Path HKLM:\SOFTWARE\Microsoft

Write TargetResource Functions for PowerShell DSC
May 12, 2015
Post comments count 0
Post likes count 0

Write TargetResource Functions for PowerShell DSC

Doctor Scripto
Doctor Scripto

Summary: Guest blogger and Microsoft PFE, Jason Walker, talks about writing Get, Set, and Test TargetResource functions for DSC. Microsoft Scripting Guy, Ed Wilson, is here. Microsoft PFE and Honorary Scripting Guy, Jason Walker, is back with us today for Part 2 of his two-part series. Yesterday in Anatomy of a PowerShell DSC Resource, I gave an overview of the anatomy of a DSC resource and explained how to use the xDscResourceDesigner module to lay down the foundation of a DSC resource. Today I will explain what is involved in writing your Get, Set, and Test TargetResource functions. I’m going to start wit...

PowerTip: Identify Location of PowerShell Providers
May 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Identify Location of PowerShell Providers

Doctor Scripto
Doctor Scripto

Summary: Identify the location of Windows PowerShell providers.  How can I find where the Windows PowerShell providers on my system come from?  Use the Get-PSProvider Windows PowerShell cmdlet, and select the Name and the ModuleName properties: Get-PSProvider | select name, modulename

Anatomy of a PowerShell DSC Resource
May 11, 2015
Post comments count 0
Post likes count 0

Anatomy of a PowerShell DSC Resource

Doctor Scripto
Doctor Scripto

Summary: Guest blogger and Microsoft PFE, Jason Walker, talks about the anatomy of a Windows PowerShell DSC resource. Microsoft Scripting Guy, Ed Wilson, is here. Today is Part 1 of a two-part series written by Microsoft PFE and Honorary Scripting Guy, Jason Walker. The majority of my "PowerShelling" lately has been around Desired State Configuration (DSC). However, the gotcha with DSC is if there isn’t a resource for the configuration area that you want to configure, you can’t use DSC for that task. Now let’s not jump to conclusions and eliminate DSC as a solution. If you can write a ...

Dude, PowerShell Changed My Life
May 7, 2015
Post comments count 0
Post likes count 0

Dude, PowerShell Changed My Life

mredwilson
mredwilson

Summary: Ed Wilson relates conversations from the Microsoft Ignite 2015 conference in Chicago. One of the great things about being at Ignite in Chicago is the opportunity to talk to so many people. I mean, with 23,000 attendees, most of whom it seems stopped by the Scripting Guys booth, the conversations are varied, and at times, downright inspirational. I had one person who was from Nigeria stop by to say “thank you.” Of, course, I should have, and I did, say thank you right back. Anyway, he said he began reading the Hey, Scripting Guy! Blog several years ago, and he taught himself Windows PowerShell...

Popcorn, Peanuts, and PowerShell
May 6, 2015
Post comments count 0
Post likes count 0

Popcorn, Peanuts, and PowerShell

mredwilson
mredwilson

Summary: Microsoft Scripting Guy, Ed Wilson, talks about day two of Microsoft Ignite 2015 in Chicago. When I was a kid, my brother and I could not wait for spring. In fact, during the winter, we carefully perused the schedule…THE schedule of the Cincinnati Reds games at Riverfront Stadium. Every year, our family would take two or three trips to Cincinnati to see the Reds play. It was a great time to be a fan, with Johnny Bench, Pete Rose, Tony Perez, and the rest of the “big red machine.” Of course, we would always pick double-headers, because if you make the trip, you want as much baseball act...

How Do You Use PowerShell?
May 5, 2015
Post comments count 0
Post likes count 0

How Do You Use PowerShell?

mredwilson
mredwilson

Summary: Microsoft Scripting Guy, Ed Wilson, talks about conversations with visitors to the Scripting Guys booth at Ignite 2015. It is Tuesday morning, and the expo is already at a dull roar of excitement. Microsoft PFEs Brian Wilhite, Jason Walker, and the Scripting Wife found a relatively quiet corner to check email, write blog posts, and generally play with our Surfaces. Jeffery Snover was here a few minutes ago asking how things are going at the Scripting Guys booth and confirming with Teresa that he will be at the Scripting Guys booth on Wednesday at 2:00 pm. One of the questions I asked people yesterday i...

Cool PowerShell Conversations at Ignite
May 4, 2015
Post comments count 0
Post likes count 0

Cool PowerShell Conversations at Ignite

mredwilson
mredwilson

Summary: Ed Wilson talks about some Windows PowerShell conversations at the Scripting Guys booth. One of the cool things about getting together with a bunch of people at the Scripting Guys booth is that I learn stuff. The conversations are great. Here is a case in point: Windows PowerShell MVP, Steve Murawski, stopped by the booth this morning. At the same time Microsoft PFEs, Gary Siepser, Brian Wilhite, and Jason Walker were here. Here is a picture: Ayway, while I was talking to Steve, I mentioned a conversation I had yesterday with a guy at lunch. I was talking about the importance of using –Whatif on a...

First Morning of Ignite in Chicago
May 4, 2015
Post comments count 0
Post likes count 0

First Morning of Ignite in Chicago

mredwilson
mredwilson

Summary: Ed Wilson talks about the first morning of Ignite conference in Chicago. It is 6:00 in the morning. I would say, "Oh dark thirty"—except it is earlier than that. The Scripting Wife and I headed downstairs from our conference hotel for the ride to the convention center. I expected it would take longer than the 15-minute ride yesterday due to the fact that it is, well, Chicago on a Monday morning. Actually, the ride, although longer, was not bad. Not bad at all. I also expected the first bus, which left at 6:30, would be rather empty. Again I was wrong. It was packed, so Teresa and I had to...

Ignite: T-1: Scripting Guys Booth Setup Day
May 3, 2015
Post comments count 0
Post likes count 0

Ignite: T-1: Scripting Guys Booth Setup Day

mredwilson
mredwilson

Summary: Microsoft Scripting Guy, Ed Wilson, talks about setting up the booth at Ignite 2015. The Scripting Wife and I arrived in Chicago last night for Microsoft Ignite 2015. As it turned out, it is an absolutely beautiful day. We herded onto the bus in front of our hotel, and headed to the conference center. It was a quick 15-minute trip. When we arrived at the conference center, we immediately met up with Rick Claus and Joey Snow. Teresa and I went into the Expo Hall, and found the Scripting Guys booth. It is right next to the Lumia area in the center of the Expo Hall. Our booth is part of the Microsoft are...

PowerTip: Keep Up with Hey, Scripting Guy! Blog
May 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Keep Up with Hey, Scripting Guy! Blog

Doctor Scripto
Doctor Scripto

Summary: Easily keep up with Hey, Scripting Guy! Blog posts.  How can I easily keep up with Hey, Scripting Guy! Blog posts?  Install the Scripting Guys app on your Windows Smart Phone. It is in the store, and it works great.

Weekend Scripter: An Ideal PowerShell Schedule for Ignite
May 2, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: An Ideal PowerShell Schedule for Ignite

Doctor Scripto
Doctor Scripto

Summary: Windows PowerShell MVP and Scripting Wife, Teresa Wilson, creates her ideal schedule for Ignite 2015 in Chicago. Microsoft Scripting Guy, Ed Wilson, is here. Today I decided to turn over the keyboard to the Scripting Wife, who is bouncing off of the walls in anticipation of Ignite starting… Greetings fellow PowerShellers! I am so excited! We just finished the Windows PowerShell Summit, and now we are on the road to Chicago for Microsoft Ignite. Tomorrow, we head to the conference center to check out our booth. Ed and I will be at the Scripting Guys booth in the Microsoft area during the hours the ...

PowerTip: Examine Default PowerShell Parameter Values
May 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Examine Default PowerShell Parameter Values

Doctor Scripto
Doctor Scripto

Summary: Examine default Windows PowerShell parameter values.  How can I check to see if I have enabled any default Windows PowerShell parameter values?  Check the value of the $PSDefaultParameterValues variable.

PowerShell Tips and Tricks: Using Default Parameter Values
May 1, 2015
Post comments count 0
Post likes count 0

PowerShell Tips and Tricks: Using Default Parameter Values

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using default Windows PowerShell parameter values. Microsoft Scripting Guy, Ed Wilson, is here. The last thing I want to talk about from the tips and tricks session of the Charlotte Windows PowerShell User Group with Lee Holmes is using default Windows PowerShell parameter values. To effectively use Windows PowerShell default parameter values, I need to first evaluate how I work. For example, if I routinely add –Wrap when I am using the Format-Table cmdlet, it might make sense for me to set that as my default. To do this, I simply need to assign a val...

It’s Not Too Late to Learn PowerShell
Apr 30, 2015
Post comments count 0
Post likes count 0

It’s Not Too Late to Learn PowerShell

mredwilson
mredwilson

Summary: Ed Wilson talks about learning Windows PowerShell. It seems that there are always new technologies. It is hard to keep up with them, and it is hard to predict which ones are even worth the time and effort to learn. As with agile development, it seems there are also agile computing technologies. Over the years, I have been to many, many technology related conventions, conferences, and training classes. The world of IT is one of endless learning. One of the big reasons for going to conferences, is to see what is on the horizon, to see what is coming up next, and to see where I will need to focus my efforts...

PowerTip: Better Way to View PowerShell Help
Apr 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Better Way to View PowerShell Help

Doctor Scripto
Doctor Scripto

Summary: Learn a better way to view Windows PowerShell Help.  I like the Windows PowerShell Help files, but I do not like trying to read them in the Windows PowerShell             console window. What is a better way to read the content?  Use the –ShowWindow parameter from Get-Help. This example displays the About_Automatic_Variables Help: Get-Help -Category helpfile automatic -ShowWindow

Select History Via PowerShell Out-Gridview
Apr 30, 2015
Post comments count 0
Post likes count 0

Select History Via PowerShell Out-Gridview

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, continues his tips and tricks series by talking about select Windows PowerShell commands via Out-GridView. Microsoft Scripting Guy, Ed Wilson, is here. One of the great things about getting a bunch of Windows PowerShell people together is that they begin to share tips and tricks they have figured out. One reason for this is that Windows PowerShell is highly discoverable. Another reason is that there is a whole lot of Windows PowerShell, and therefore, there is a whole bunch of stuff to discover. Many times (at least for me), the coolest tips and tricks are not somethin...

PowerTip: Find PowerShell Profiles
Apr 29, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Profiles

Doctor Scripto
Doctor Scripto

Summary: Learn how to easily find Windows PowerShell profiles.  How can I Question: You want to find the path to Windows PowerShell profiles?  Use the $Profile automatic variable, but pipe the output to the Format-List cmdlet and use            the –Force parameter. Here is an example that uses the FL alias for Format-List): $profile | fl * -Force

PowerShell Tips and Tricks: Extended History
Apr 29, 2015
Post comments count 0
Post likes count 0

PowerShell Tips and Tricks: Extended History

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about a module that provides extended command history. Microsoft Scripting Guy, Ed Wilson, is here. One of the things that came up during the Charlotte Windows PowerShell User Group meeting was the HistoryPx module that was written by Windows PowerShell MVP, Kirk Munro. This module adds additional history information to the Windows PowerShell console. For example, he adds information about the duration of a command, the output of the command, and errors generated by the command. Installing  HistoryPx Installing the HistoryPx module is really easy because it ...

PowerTip: Retrieve Last Token Received by PowerShell
Apr 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Retrieve Last Token Received by PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to retrieve the last token that was received by Windows PowerShell.  How can I retrieve the last token received by Windows PowerShell?  Use the $$ automatic variable: PS C:\> notepad C:\fso\AMoreComplete.txt PS C:\> $$ C:\fso\AMoreComplete.txt

Use PSReadLine for More Efficient PowerShell Console
Apr 28, 2015
Post comments count 0
Post likes count 0

Use PSReadLine for More Efficient PowerShell Console

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, presents a tip from the Charlotte User Group meeting about using PSReadLine. Microsoft Scripting Guy, Ed Wilson, is here. One really big tip that came out during the Charlotte User Group meeting was to use the PSReadLine module. It provides is syntax highlighting, which makes it easier to understand commands and spot errors because I can see how Windows PowerShell is interpreting something. For example, in the following image, the cmdlet is colored yellow, parameters are gray, variables are green, and the output is white. If I am trying to run a command...

PowerTip: Find User's Home Directory in PowerShell
Apr 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Find User's Home Directory in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Find the path to the current user's home directory in Windows PowerShell.  How can I easily find the current user's home directory for a script I am writing?  Use the $home automatic variable: PS C:\> $HOME

Favorite PowerShell Tips and Tricks
Apr 27, 2015
Post comments count 0
Post likes count 0

Favorite PowerShell Tips and Tricks

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about Windows PowerShell tips and tricks from the Charlotte User Group meeting. Microsoft Scripting Guy, Ed Wilson, is here. Last week was a special meeting at the Charlotte Windows PowerShell User Group. It followed immediately after the Windows PowerShell Summit, and as a result, the user group included five members of the Windows PowerShell team, nearly a dozen MVPs, and at least that many Microsoft employees. All in all, there were nearly a hundred people in the room, and that, I believe, makes it the largest Windows PowerShell User Group meeting so far in Ch...

PowerTip: Find Current Directory in PowerShell
Apr 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Current Directory in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Easily find the current directory in Windows PowerShell.   How can I return a path object that contains information about the current working directory in Windows PowerShell?  Use the $pwd automatic variable: PS C:\> $pwd

Weekend Scripter: My First PowerShell Summit
Apr 26, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: My First PowerShell Summit

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Will Anderson, talks about his first Windows PowerShell Summit. Microsoft Scripting Guy, Ed Wilson, is here. Wow! What a week...or part of a week. Windows PowerShell Summit North America 2015 was here in Charlotte, NC this past week. The Scripting Wife and I met a lot of new people and made new friends. One of these friends is a brand new Windows PowerShell MVP, Will Anderson. Will wrote a blog post about his time here in Charlotte. First a little about Will... Will Anderson is a thirteen-year infrastructure veteran with a specialization in patch management, compliance, and Sys...

PowerTip: Determine if Property is Member of Object
Apr 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Determine if Property is Member of Object

Doctor Scripto
Doctor Scripto

Summary: Determine if a property is a member of an object in Windows PowerShell.  How can I determine if a specific property is actually a member of an object in my Windows PowerShell script?  Use the Get-Member cmdlet, and cast the response into a Boolean data type by using the [bool] type             accelerator, for example: [bool](Get-member -Name time -InputObject (get-date) -MemberType Property) Note  I got this idea from Microsoft PFE, Clint Huffman. He uses it in his PAL data collector. He has a note in that script that says he got the ...

Weekend Scripter: Scripting Guys Ignite Booth Schedule
Apr 25, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Scripting Guys Ignite Booth Schedule

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Scripting Guys booth schedule. Microsoft Scripting Guy, Ed Wilson, is here. It is that time of year again. Conference time. TechEd North America is no more, but Microsoft Ignite is on the horizon. May 4-8, 2015 in Chicago! It is already sold out, but you can see the presentations as they are being recorded. Windows PowerShell MVP, Teresa Wilson (aka The Scripting Wife) is with us today to share the schedule of special guests you can meet at the Scripting Guys booth. Take it away, Teresa... I have a working schedule to share with you regarding who y...

PowerTip: Roll Back Active PowerShell Transaction
Apr 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Roll Back Active PowerShell Transaction

Doctor Scripto
Doctor Scripto

Summary: Learn how to roll back an active Windows PowerShell transaction.  I started a transaction to modify the registry on my computer running Windows 8.1, but something failed,            and I want to roll back the transaction. How can I do this?  Use the Undo-Transaction cmdlet to roll back the active transaction.

Use PowerShell to Move User Files and Update Registry
Apr 24, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Move User Files and Update Registry

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to move user files and update the registry.  Hey, Scripting Guy! I need to move a bunch of user files from their local computer to a network share so we can back up the user's data prior to migrating their desktops. I know there are various tools I can use to do this, but our scenario is pretty simple because the user profile data is all located in specific folders. After I have moved their data, I need to update a registry key. That key will be read by another app, and the machines will be wiped before we drop a new image...

PowerTip: Set Default Location Stack with PowerShell
Apr 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Set Default Location Stack with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to set your default location stack.  How can I use Windows PowerShell to set the default for some named location stacks that I created?  Use the Set-Location cmdlet and specify the stack name, for example: Set-Location -StackName REG

Using Transactions with PowerShell Registry Provider
Apr 23, 2015
Post comments count 0
Post likes count 0

Using Transactions with PowerShell Registry Provider

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using transactions with the Windows PowerShell Registry provider.  Hey, Scripting Guy! I was looking at the various providers and their capabilities (see Find and Use Windows PowerShell Providers). I see that the Registry provider says it does transactions. What’s that all about? —JS  Hello JS, Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sipping a cup of tea from some tea that Windows PowerShell MVP, Sean Kearney, brought me from Ottawa. There just happens to be an awesome tea shop there, and Sean volunteered to brin...

PowerTip: Display Locations Stored on Stack
Apr 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Display Locations Stored on Stack

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display locations stored on the default stack.  How can I use Windows PowerShell to see the locations that are stored on my default location stack?  Use the –Stack parameter of Get-Location: Get-Location -Stack

Using Named Location Stacks in PowerShell
Apr 22, 2015
Post comments count 0
Post likes count 0

Using Named Location Stacks in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using named location stacks in Windows PowerShell.  Hey, Scripting Guy! If I need to move around in two types of locations, how would I do it? Suppose I need to look in various places in my profile, and then I need to do some work in data locations elsewhere on my hard drive. How would I be able to keep track of the different locations? —AK  Hello AK, Microsoft Scripting Guy, Ed Wilson, is here. Today is the last day of the Windows PowerShell Summit in Charlotte. In fact, tonight the Charlotte Windows PowerShell User Group is having a specia...

PowerTip: Find PowerShell Cmdlets and Synopsis
Apr 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Cmdlets and Synopsis

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find cmdlets and their associated synopsis.  How can I easily find a list of specific Windows PowerShell cmdlets and their associated meanings?  Use the Get-Command cmdlet, pipe the results to the Foreach-Object and Get-Help cmdlets,            then select the name and synopsis, for example: gcm -Noun item* | % {get-help $_} | ft name, synopsis

Location, Location, Location in PowerShell
Apr 21, 2015
Post comments count 0
Post likes count 0

Location, Location, Location in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about managing locations in Windows PowerShell.  Hey, Scripting Guy! I don’t understand what is the big deal with Get-Location. I mean, I can look and see where I am at, so why do I need Get-Location? For that matter, what are a PushD and a PopD? It says it has something to do with a stack, but I don’t know where that stack is, or even what a stack is. Can you help? —DW  Hello DW, Microsoft Scripting Guy, Ed Wilson, is here. The weather in Charlotte finally cleared up. It has been rather cold and wet the past couple days. This is kind ...

PowerTip: Find PowerShell Providers
Apr 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Providers

Doctor Scripto
Doctor Scripto

Summary:  Learn how to find Windows PowerShell providers and their capabilities.  How can I find what Windows PowerShell providers I have on my system?  Use the Get-PSProvider cmdlet. Note  Beginning with Windows PowerShell 3.0, some providers load on-demand, and therefore, they do not appear unless they have been accessed at least once. The WSMAN provider is an example of such a provider.

Find and Use Windows PowerShell Providers
Apr 20, 2015
Post comments count 0
Post likes count 0

Find and Use Windows PowerShell Providers

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about finding and using Windows PowerShell providers.  Hey, Scripting Guy! I recently heard a Windows PowerShell MVP say that understanding the Windows PowerShell provider system is fundamental to understanding Windows PowerShell. I think I am in trouble because I have no idea what he is talking about. Can you throw a fella a bone? —DP  Hello DP, Microsoft Scripting Guy, Ed Wilson, is here. I am sipping a rather bland cup of tea, but I don’t care because it is a great day. In fact, the weather in Charlotte, North Carolina was rather cold and...

PowerTip: Return Specific Number of Letters from String
Apr 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Return Specific Number of Letters from String

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to return a specific number of letters from a string.  How can I use Windows PowerShell to easily to retrieve the first two letters from a string?  Use the SubString method from a string, and then specify the starting the position and the number            of letters to return, for example: PS C:\> ("string").Substring(0,2) st

Weekend Scripter: Use PowerShell to Create Users in Active Directory
Apr 19, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell to Create Users in Active Directory

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to read a CSV file and create users in Active Directory. Microsoft Scripting Guy, Ed Wilson, is here. Yesterday in Oh No! Oh Wait...PowerShell for the Win!, I created a CSV file from a Word document that I had been given. Today, I take the next logical step and create the users. When I have a working CSV file, I can begin the process of writing a script that will create the users in Active Directory. Note  The CSV file that I was given had more than 1,200 lines in it. Although I gave it a quick “once over glance,” I...

PowerTip: Save CSV Data and Maintain Unicode Encoding
Apr 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Save CSV Data and Maintain Unicode Encoding

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to save data as a CSV file and maintain the Unicode encoding.  How can I use Windows PowerShell to save my data as a CSV file but ensure that it is saved as Unicode?  Make sure you specify the –Encoding parameter when you call the Export-CSV cmdlet, for example: Export-Csv -Path C:\Data\Names.CSV -Encoding Unicode -NoTypeInformation

Weekend Scripter: Oh No! Oh Wait…PowerShell for the Win!
Apr 18, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Oh No! Oh Wait…PowerShell for the Win!

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to clean up an impossible document. Microsoft Scripting Guy, Ed Wilson, is here. Sometimes I just cringe. It is a reflex reaction born from many long (and at times, torturous) years in the IT field. I know, I should be able to get over it, and sometimes I actually think I am getting better. And then things like the following crop up in my email... I recently received a panic email from an IT admin. He was tasked with creating over 1,200 new user accounts. Hey, no problem. Give me a properly formatted CSV file or Excel spreadsheet, a...

PowerTip: Use PowerShell to Remove All CIM Sessions
Apr 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Remove All CIM Sessions

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to remove all CIM sessions.  How can I use Windows PowerShell to delete all the CIM sessions I have created?  Use the Get-CIMSession cmdlet to retrieve all CIM sessions, and pipe the results to the            Remove-CIMSession cmdlet: Get-CimSession | Remove-CimSession

Combine PowerShell Remoting and CIM
Apr 17, 2015
Post comments count 0
Post likes count 0

Combine PowerShell Remoting and CIM

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about combining Windows PowerShell remoting and CIM. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about Windows PowerShell is remoting. It is not a new feature. In fact, it was introduced in Windows PowerShell 2.0—a time that seems like eons ago. Really. That was back in Windows Server 2008 R2, so that was in 2009. Anyway, it is turned on by default in Windows Server 2012 and later. Windows PowerShell remoting lets me connect to remote servers or workstations, over a single port, and in a secure manner. In addition, it ...

PowerTip: Find WMI Parent Class with PowerShell
Apr 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Find WMI Parent Class with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily find a WMI parent class.  How can I use Windows PowerShell to find what parent class a particular WMI class derives from?  Use the Get-CimClass cmdlet, and select the CimSuperClassName property, for example: (Get-Cimclass win32_bios).CimSuperClassName

Look at Schema of WMI Class with PowerShell
Apr 16, 2015
Post comments count 0
Post likes count 0

Look at Schema of WMI Class with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to look at the schema of a WMI class. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about WMI is that it is largely self-describing. This means that I can use WMI and look at WMI. With the CIM cmdlets, this goes even a step further. For example, if I want to look at the Win32_Desktop WMI class, I can use the Get-CimClass cmdlet, and examine it: PS C:> Get-CimClass win32_desktop    NameSpace: ROOT/cimv2 CimClassName         CimClassMethods      CimClassPr...

PowerTip: Remove Type Data with PowerShell
Apr 15, 2015
Post comments count 0
Post likes count 0

PowerTip: Remove Type Data with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to remove type data by using Windows PowerShell.  How can I remove a custom type data that is producing an error message when I try to update it            in my Windows PowerShell session?  Use the Get-TypeData cmdlet to retrieve an instance of the type data, and pipe it to the            Remove-TypeData cmdlet, for example: "Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_Volume" |Get-TypeData | Remove-TypeData Note  This is a long single-line command that is broken a...

Create Custom Type Data in PowerShell to Format WMI Display
Apr 15, 2015
Post comments count 0
Post likes count 0

Create Custom Type Data in PowerShell to Format WMI Display

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about creating custom type data to control the way a WMI class displays.  Hey, Scripting Guy! Yesterday, you said you could create custom type data to control the way the Win32_Volume WMI class reports back. How would one go about doing that? I looked on the Internet, and to be honest, it looks like it is basically impossible. —AT  Hello AT, Microsoft Scripting Guy, Ed Wilson, is here. I love this time of the year. All the windows are open, the azaleas are in bloom, and I am upstairs with my Surface Pro 3, a cup of orange-cream green tea, and...

PowerTip: Use PowerShell to Find Cmdlets that Use CIM
Apr 14, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Cmdlets that Use CIM

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find cmdlets that use CIM.  I want to see what Windows PowerShell cmdlets will use a CIM session, but when I use Get-Command,            only a couple things return. How can I fix this?  Windows PowerShell automatically loads modules, but when looking for parameters, it does not load modules.            Therefore, if you want to see all the commands that use a CIM session, first load the modules, then search for            commands that accept the CIMSession pa...

Comparing CIM and WMI in PowerShell
Apr 14, 2015
Post comments count 0
Post likes count 0

Comparing CIM and WMI in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about comparing CIM and Windows PowerShell.  Hey, Scripting Guy! When I query using a CIM function, I get back different stuff than when I query WMI. I don’t get it. Can you help? —BW  Hello BW, Microsoft Scripting Guy, Ed Wilson, is here. Yesterday in Working with Volumes in CIM, I began talking about WMI and CIM. Let’s continue by looking more in depth at what happens with Get-Volume and Win32_Volume. Anyone who has done a lot of work with WMI and with Windows PowerShell knows about types and type data. For example, when I query the ...

PowerTip: Use PowerShell to Find File or Folder
Apr 13, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find File or Folder

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find a file or a folder.  How can I use Windows PowerShell to determine if a variable contains a path that leads to a file or folder?  Use the Test-Path cmdlet to test the path stored in the variable, and then specify the PathType parameter,           for example: PS C:\> $fso = "c:\fso" PS C:\> $file = "C:\fso\backup.ps1" PS C:\> Test-Path $fso -PathType leaf False PS C:\> Test-Path $file -PathType leaf True

Working with Volumes in CIM
Apr 13, 2015
Post comments count 0
Post likes count 0

Working with Volumes in CIM

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about working with volumes with Windows PowerShell and CIM.  Hey, Scripting Guy! I don’t understand CIM at all. I mean, I thought it was basically WMI, but when I use WMI to look at volumes, I see different stuff. Can you help me? —AB  Hello AB, Microsoft Scripting Guy, Ed Wilson, is here. There are some questions that seem to be rather easy to answer, and then become confusing. So I am going to jump in and introduce CIM Week. The Windows Management Instrumentation (WMI) is Microsoft’s implementation of the Common Information Model (CI...

PowerTip: Use PowerShell to Find Files in Wrong Folder
Apr 12, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Files in Wrong Folder

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily find files that are in the wrong folder.  I have a folder for documents and another folder for images. But at times, I discover images in the            documents folder. How can I use Windows PowerShell to easily detect this situation?  Use the Test-Path cmdlet, and specify the file extension to exclude, for example: PS C:\> test-path c:\fso -Exclude *.bmp True PS C:\> dir c:\fso -Include *.bmp PS C:\> 

Weekend Scripter: Use PowerShell to Work with Embedded Objects
Apr 12, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell to Work with Embedded Objects

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to work with embedded objects. Microsoft Scripting Guy, Ed Wilson, is here. This morning I have my Zune 1.0 cranked up, and I am listening to some tunes. I have a nice cup of English Breakfast tea, and a warm croissant beside me. I also was able to score some homemade orange marmalade. Anyway, a few years ago, the Scripting Wife and I were in Maui, Hawaii, and we took an early morning drive up a winding road. We entered clouds, and it seemed like it was raining. I thought about turning back because of the rain, but there was no good...

PowerTip: Find Stats with PowerShell
Apr 11, 2015
Post comments count 0
Post likes count 0

PowerTip: Find Stats with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find stats of objects.  How can I use Windows PowerShell to see the minimum, maximum, and average values of a            specific property in a series of objects?  Pipe the objects to the Measure-Object cmdlet, specify the property you seek, and use            the Average, Maximum, Sum, and Minimum switches, for example: $objects | Measure-Object -Property numberofwords -Sum -Average -Maximum -Minimum 

Weekend Scripter: Use PowerShell to Analyze Custom Objects
Apr 11, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell to Analyze Custom Objects

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to analyze custom objects. Microsoft Scripting Guy, Ed Wilson, is here. Last week, I talked about using a Windows PowerShell script to collect the number of words and documents for each of several years. To this, I wrote a Windows PowerShell script that trolled a number of folders, opened the Word documents, and gathered the word count. (See Use PowerShell to Count Words and Display Progress Bar.) The real power of the script comes not in simply emiting the objects to the Windows PowerShell console, but in collecting the objects, an...

PowerTip: Use PowerShell to Display Shared Folders
Apr 10, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display Shared Folders

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display shared folders.  How can I use Windows PowerShell to display shared folders that I set up on a local computer?  Use the Get-SMBShare cmdlet and no parameters.

Meet the PowerShell Summit 2015 Speakers #5
Apr 10, 2015
Post comments count 0
Post likes count 0

Meet the PowerShell Summit 2015 Speakers #5

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Windows PowerShell Summit 2015 speakers. Microsoft Scripting Guy, Ed Wilson, is here. Today is the final day for guest blogger, Teresa Wilson, to tell you about some of the speakers and sessions for the upcoming North America PowerShell Summit 2015 in Charlotte, NC. Thanks Ed. It has been my pleasure to write this week about some of the speakers and sessions coming up at the Summit. I made a deliberate effort to not include all the sessions and speakers—can’t spill all the beans. There will be sessions by members of the Windows PowerShe...

PowerTip: Use PowerShell to Verify Syntax of Path
Apr 9, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Verify Syntax of Path

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to verify the syntax of a path.  How can I use Windows PowerShell to verify that a path that accepts user input is using the correct syntax?  Use the –IsValid parameter of the Test-Path cmdlet, for example: PS C:\> $a = "c:\myfolder\nonexistentfile.txt" PS C:\> Test-Path $a -IsValid True PS C:\> $b = "c:\my()(*&^%\afile.txt" PS C:\> Test-Path $b -IsValid False Note  This command verifies if the syntax is correct for the provider, but it does not verify if the file exists.

Meet the PowerShell Summit 2015 Speakers #4
Apr 9, 2015
Post comments count 0
Post likes count 0

Meet the PowerShell Summit 2015 Speakers #4

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Windows PowerShell Summit 2015 speakers. Microsoft Scripting Guy, Ed Wilson, is here. We continue with guest blogger, Teresa Wilson, as she shares some of the speakers and their sessions for the North America PowerShell Summit 2015. Let’s kick off today with Jeffery Hicks. Jeff is a Windows PowerShell MVP, and he is on the Board of Directors for PowerShell.org. He has been a guest blogger on this site, and he is being an Honorary Scripting Guy. I can go on for pages about the other things he is involved in, but I won’t do that today. Jeff's s...

PowerTip: Use PowerShell to Find Files Newer than a Date
Apr 8, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Files Newer than a Date

Doctor Scripto
Doctor Scripto

Summary: Use the Windows PowerShell to see if a file exists more recent than a certain date.  How can I use Windows PowerShell to see if a file more recent than a specific date exists in a folder?  Use the Test-Path cmdlet, specify the folder, and use the –NewerThan parameter.            The cmdlet expects a date in accordance with regional settings, for example: PS C:\> Test-Path c:\fso -NewerThan 3/30/15 True PS C:\> Test-Path c:\fso -NewerThan 4/3/15 False

Meet the PowerShell Summit 2015 Speakers #3
Apr 8, 2015
Post comments count 0
Post likes count 0

Meet the PowerShell Summit 2015 Speakers #3

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Windows PowerShell Summit speakers. Microsoft Scripting Guy, Ed Wilson, is here. The Scripting Wife, Teresa Wilson, is my guest blogger all week. She is bringing you information about the speakers for the North America PowerShell Summit 2015 and their sessions. Don’t worry if you cannot attend the Summit. The sessions will be recorded and shared on You Tube. Happy Wednesday everyone! I am back to share with you again. Today, I am starting with Windows PowerShell MVP, Jason Helmick. Jason is the CFO for PowerShell.org and the person I work clo...

PowerTip: Use PowerShell to See Hidden and Non-Hidden Files
Apr 7, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to See Hidden and Non-Hidden Files

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to see hidden and non-hidden files.    How can I use Windows PowerShell to see all hidden and non-hidden files in a folder?  Use the Get-ChildItem cmdlet and specify the –File and the –Force switches.            Here is an example that uses the GCI alias: gci -Force -File

Meet the PowerShell Summit 2015 Speakers #2
Apr 7, 2015
Post comments count 0
Post likes count 0

Meet the PowerShell Summit 2015 Speakers #2

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Windows PowerShell Summit speakers. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger, Teresa Wilson, as she continues introducing you to the speakers for the PowerShell Summit and their sessions. Thanks Ed. I'm glad to have this opportunity to tell you a little bit about some of the speakers for the North America PowerShell Summit 2015 in Charlotte, NC. What would the PowerShell Summit be without PowerShell.org and our fearless leader, Don Jones? Don is a Windows PowerShell MVP and Honorary Scripting Guy. In his ses...

PowerTip: Use PowerShell to Display Only Hidden Files
Apr 6, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Display Only Hidden Files

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display only hidden files.  How can I use Windows PowerShell to locate only hidden files?  Use the Get-ChildItem cmdlet and specify the Not Directory and the Hidden attributes (abbreviate as !d+h): gci -Att !d+h

Meet the PowerShell Summit 2015 Speakers #1
Apr 6, 2015
Post comments count 0
Post likes count 0

Meet the PowerShell Summit 2015 Speakers #1

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about the Windows PowerShell Summit 2015 speakers. Microsoft Scripting Guy, Ed Wilson, is here. This week we will be talking about the PowerShell Summit. So who better to write some guest blog posts but the treasurer for PowerShell.org—my very special Scripting Wife and Windows PowerShell MVP, Teresa Wilson. Take it away Teresa... Hello everyone! Thanks for stopping by and reading the blog today. I am all excited. It is April, which means I just returned from the US Open Days inaugural event in Malvern, PA for US MVPs, and I was renewed as a PowerShell...

PowerTip: Use PowerShell to Find Folders that Match Pattern
Apr 5, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Folders that Match Pattern

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find folders with names that match a specific pattern.  How can I use Windows PowerShell to find the path to folders that have names that match a specific pattern?  Use the Get-ChildItem cmdlet and the –Filter parameter with a pattern that matches the name, and then            specify the  –Directory parameter. Here is an example that matches folders that have a four-letter name: Get-ChildItem E:\Data\ScriptingGuys -filter "????" -Directory |  % { $_.fullname }

Weekend Scripter: Use PowerShell to Count Words and Display Progress Bar
Apr 5, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell to Count Words and Display Progress Bar

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to display a progress bar while counting the number of words in Word documents. Microsoft Scripting Guy, Ed Wilson, is here. One of the things that a writer does is keep track of words. This is not so much because one gets paid by the word (although in the past that was actually true, and it is still true for some magazines). It is more because publishers need to know how many words will be in a book for planning purposes. It goes to the production budget, it goes to planning for shelf space in bookstores, and it influences the cost...

PowerTip: Use Filter Parameter with Get-ChildItem in PowerShell
Apr 4, 2015
Post comments count 0
Post likes count 0

PowerTip: Use Filter Parameter with Get-ChildItem in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the –Filter parameter with the Get-ChildItem Windows PowerShell cmdlet.  Why can't I get the –Filter parameter to work with the Get-ChildItem cmdlet?  Try using the FileSystem provider. The –Filter parameter will accept two wildcard characters ( ? and * )            and a single string as a filter (not an array of strings like the –Include parameter uses). Here is an example           of using –Filter&nb...

Weekend Scripter: Using PowerShell to Look for Documents
Apr 4, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Using PowerShell to Look for Documents

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about different approaches to find documents with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. It is a lovely weekend down here in the deep south USA. I am sipping a nice cup of English Breakfast tea with lemon, lime, orange pith, and Hibiscus flower added. I decided to leave out the cinnamon stick this morning to see what would happen. What happened is that the resulting tea is mellow and tangy at the same time. I have the Rolling Stones cranked up on my Zune 2.0, and I am hanging out enjoying the beautiful weather. I also...

PowerTip: Look at Most Recent Error in PowerShell
Apr 3, 2015
Post comments count 0
Post likes count 0

PowerTip: Look at Most Recent Error in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to see the most recent error in Windows PowerShell.  I ran a script that fails. How can I use Windows PowerShell to find the most recent error?  Use $error, and to see the most recent error, look at error 0: $error[0]

Catch PowerShell Errors Related to Reading the Registry
Apr 3, 2015
Post comments count 0
Post likes count 1

Catch PowerShell Errors Related to Reading the Registry

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Try, Catch, Finally blocks to catch Windows PowerShell errors related to reading the registry.  Hey, Scripting Guy! Yesterday you posted Update or Add Registry Key Value with PowerShell. Would it be easy to use Try, Catch, Finally blocks to know if I need to create the registry key or the registry key property? How can I do that? It doesn't seem very simple to me. —AP  Hello AP, Microsoft Scripting Guy, Ed Wilson, is here. The biggest challenge to using structured error handling in a Windows PowerShell script (beyond the most simp...

PowerTip: Use PowerShell to Read Registry Key Property Value
Apr 2, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Read Registry Key Property Value

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to read a registry key property value.  How can I use Windows PowerShell to read a registry key property value so I can find the version of a particular software package?  Use the Get-ItemProperty cmdlet, for example: Get-ItemProperty -Path HKCU:\Software\ScriptingGuys\Scripts -Name version

Update or Add Registry Key Value with PowerShell
Apr 2, 2015
Post comments count 2
Post likes count 3

Update or Add Registry Key Value with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to update or add a registry key value.  Hey, Scripting Guy! I am having a problem trying to update the registry. I am using the New-ItemProperty cmdlet, but it fails if the registry key does not exist. I added the –Force parameter, but it still will not create the registry key. The error message says that it cannot find the path because it does not exist. Is there something I am not doing? I am including my script so you can see what is going on. Help me please. —DC  Hello DC, Microsoft Scripting Guy, Ed Wilson...

PowerTip: Use PowerShell to Get File Hash
Apr 1, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Get File Hash

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to get a file hash.  How can I use Windows PowerShell to get a hash of a file?  Use the Get-FileHash cmdlet, for example: (Get-FileHash C:\fso\myfile.txt).hash

Use PowerShell to Compare Two Files
Apr 1, 2015
Post comments count 0
Post likes count 1

Use PowerShell to Compare Two Files

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to compare two files.  Hey, Scripting Guy! I have a script that I wrote to compare two files, but it seems really slow. I am wondering what I can do to speed things up a bit. —JW  Hello JW, Microsoft Scripting Guy, Ed Wilson, is here. I looked at the script you supplied, where you use Compare-Object to compare two files. Here is your script: $fileA = "C:\fso\myfile.txt" $fileB = "C:\fso\CopyOfmyfile.txt" $fileC = "C:\fso\changedMyFile.txt" if(Compare-Object -ReferenceObject $(Get-Content...

PowerTip: Create Array in PowerShell
Mar 31, 2015
Post comments count 0
Post likes count 0

PowerTip: Create Array in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily create an array.  Can I use Windows PowerShell to create an array of strings and avoid typing quotation marks            around all the strings?  Instead of creating an array, such as this: $array = “a”,”b”,”c”,”d”,”e”,”f”,”g”,”h”, use a single string,            and split it at the comma. It will be much less typing, and a whole lot faster. Here is an example: $array = 'a,b,c,d,e,f,g,h'.Split(&#039...

Help Comparing Objects in PowerShell
Mar 31, 2015
Post comments count 0
Post likes count 0

Help Comparing Objects in PowerShell

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, helps a reader compare two objects in Windows PowerShell.  Hey, Scripting Guy! I am having a problem with a script. I wrote a function to compare virtual machines with virtual drives that I have on my hard drive, and it works just fine. But when I try to put the thing into a larger script, and get the path from those drives, well, it just won’t work. In fact, all I get is gibberish. I am pasting my code into a different email. I hope you can help me. —RL  Hello RL, Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sipping a wonderful ...

PowerTip: Use PowerShell to See if Media Center is Installed
Mar 30, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to See if Media Center is Installed

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to determine if a Windows 8.1 has Media Center installed.  How can I use Windows PowerShell to determine if a version of Windows 8.1 has Media Center installed?  Use WMI and look at the Caption property of the Win32_OperatingSystem WMI class, for example: (Get-CimInstance Win32_OperatingSystem).caption Note  You can also use the alias GCIM, or use Get-WmiObject (alias GWMI).

Use PowerShell to Detect if Hypervisor is Present
Mar 30, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Detect if Hypervisor is Present

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to determine if a hypervisor is present  Hey, Scripting Guy! I have been trying to use WMI to determine if a server has the hypervisor present. I found the WMI class, and even the properties I need. But alas, the WMI class seems to be broken, and it is causing my Windows PowerShell script to fail. For your information, I have been using the Win32_Processor WMI class because it seems to have the properties I need. I know there are various tools I can download that provide this information, but I prefer to use something native if...

PowerTip: How to Find PowerShell User Groups
Mar 29, 2015
Post comments count 0
Post likes count 0

PowerTip: How to Find PowerShell User Groups

Doctor Scripto
Doctor Scripto

Summary: Learn how to find Windows PowerShell user groups.  Where do I begin a search to find if there is a Windows PowerShell user group in my area?  There are two primary places for finding Windows PowerShell user group information:

Weekend Scripter: Special Charlotte PowerShell User Group Meeting
Mar 29, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Special Charlotte PowerShell User Group Meeting

Doctor Scripto
Doctor Scripto

Summary: On April 22, the Charlotte Windows PowerShell User Group will host Lee Holmes and Paul Higginbotham. Microsoft Scripting Guy, Ed Wilson, is here. Sometimes things just work out. The other day, I received an email from Lee Holmes. He is speaking at the Windows PowerShell Summit, which will be hosted in Charlotte, NC, on April 20 – 22. This event sold out in just a few days, and when additional tickets were added, it sold out again. It would probably be easier to get tickets to the NCAA basketball tournament, than it is to get tickets to this event. After all, after basketball teams lose, many people...

PowerTip: Find PowerShell Sessions at Ignite
Mar 28, 2015
Post comments count 0
Post likes count 0

PowerTip: Find PowerShell Sessions at Ignite

Doctor Scripto
Doctor Scripto

Summary: See the scheduled Windows PowerShell sessions for Microsoft Ignite.  I am planning to attend the Microsoft Ignite conference in Chicago this year! How can I find what Windows PowerShell            sessions are on the schedule?  Go to the Microsoft Ignite page, and filter on Windows PowerShell: Windows PowerShell Sessions.            Also keep in mind that many other sessions may have a heavy Windows PowerShell content,            but they are not specifically keyed as Windows PowerShell sessions.

PowerShell Spotlight: Scripting Guys at Ignite
Mar 28, 2015
Post comments count 0
Post likes count 0

PowerShell Spotlight: Scripting Guys at Ignite

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Teresa Wilson, talks about plans for the Scripting Guys booth at Ignite in Chicago. Microsoft Scripting Guy, Ed Wilson, is here. Today we have Windows PowerShell MVP, Teresa Wilson (aka The Scripting Wife) with another edition of PowerShell Spotlight... It is almost April which means conference season is about to begin. I am so excited. The first conference is the PowerShell Summit in Charlotte April 20-22. This event is sold out. It is going to be an awesome three days. If you are in the Charlotte area and did not get tickets to the Summit (or even if you did and are going to b...

PowerTip: Use PowerShell to Find Installed Optional Features
Mar 27, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Installed Optional Features

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to find installed optional features in Windows.  How can I use Windows PowerShell to see what optional features are installed in a copy of Windows?  Use the Get-WindowsOptionalFeature cmdlet, and if you are looking at a version of Windows            that is running, use the –Online switch: Get-WindowsOptionalFeature -Online

Use PowerShell to Remove Optional Features from Windows VHD
Mar 27, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Remove Optional Features from Windows VHD

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to remove optional features from Windows virtual hard disks.  Hey, Scripting Guy! I have a number of virtual machines that have optional features that they do not need, such as Windows Media Player. In fact, the virtual machines are set up with no audio, so having Windows Media Player is sort of a waste. How can I easily remove this feature? —CG  Hello CG, Microsoft Scripting Guy, Ed Wilson, is here. This morning started off early. IIS MVP, Teri Donahue, stopped by to pick up Teresa’s Surface Pro 2. T...

PowerTip: Find DISM-Related PowerShell Cmdlets
Mar 26, 2015
Post comments count 0
Post likes count 0

PowerTip: Find DISM-Related PowerShell Cmdlets

Doctor Scripto
Doctor Scripto

Summary: Learn how to find all Windows PowerShell cmdlets that work with DISM.  How can I find all Windows PowerShell cmdlets that work with Deployment Image Servicing and Management (DISM)?  Use the Get-Command cmdlet and specify the DISM module: Get-Command -Module dism

Use PowerShell to Add Files to Offline Windows Image
Mar 26, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Add Files to Offline Windows Image

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to add files to an offline Windows image.  Hey, Scripting Guy! I have a number of VHDs that I need to add files to. I know that I can use File Manager to mount the VHD and then copy the files, but I am hoping that I can use Windows PowerShell to do this. The VHDs are for virtual machines that I run in my lab. Can you help? —AM  Hello AM, Microsoft Scripting Guy, Ed Wilson, is here. Today I am a bit sore. I finally made it back into the gym yesterday, and my trainer seemed to have it in for me. Anyway, I am listening ...

PowerTip: Use PowerShell to Find Virtual Hard Disks
Mar 25, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Virtual Hard Disks

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find virtual hard disks on your system.  I notice that my disk space appears to be disappearing at a rapid rate, and I suspect someone is creating            virtual hard disks (VHDs) and forgetting about them. How can I use Windows PowerShell to find all the            VHDs on my system?  Use the Get-ChildItem (LS, Dir, gci are aliases), use a filter like *.vhd*, and specify the Recurse switched            parameter. To simply report on the...

Use PowerShell to Explore Old Windows VHDs
Mar 25, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Explore Old Windows VHDs

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore old Windows VHDs.  Hey, Scripting Guy! It is time for spring clean-up around our datacenter. I am not talking about chasing out dust bunnies, although that is part of it. What I am talking about is trying to determine what can be safely deleted without annoying the users too badly. We have a lot of virtual machines that could have data on them, but I do not know the passwords, and I do not want to go to the trouble of creating virtual machines, mounting the drives, and launching the things to see if there is any user...

PowerTip: Use PowerShell to See Who Can Access Folder
Mar 24, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to See Who Can Access Folder

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to see who has access to a folder.  How can I use Windows PowerShell to see who has access rights to a folder?  Use the Get-Acl cmdlet, specify the folder, and look at the access property, for example: (Get-Acl c:\fso).Access  

Use PowerShell to Disable Wi-Fi
Mar 24, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Disable Wi-Fi

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to disable Wi-Fi if Ethernet is connected.  Hey, Scripting Guy! When I have an Ethernet cable plugged in to my laptop and I am connected to a network, I want to ensure that everything else is disabled. How can I do that by using Windows PowerShell? —DH  Hello DH, Microsoft Scripting Guy, Ed Wilson, is here. This morning is a bit cool, and definitely moist outside. It is not raining, but it seems like it could easily do so. It sort of reminds me of winter mornings in Florida, when it was cool and damp. I have not seen...

PowerTip: Use PowerShell to Disable All Network Adapters
Mar 23, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Disable All Network Adapters

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to disable all network adapters on your system.  I often work in offline situations, and I would like to disable all network adapters on my laptop for security reasons            and to help to extend battery life. How can I use Windows PowerShell to do this easily?  Use the Get-NetAdapter cmdlet to retrieve all network adapters and pipe the results to the            Disable-NetAdapter cmdlet. To suppress confirmation messages use the –Confirm parameter       &nb...

Use PowerShell to Enable Wi-Fi
Mar 23, 2015
Post comments count 0
Post likes count 0

Use PowerShell to Enable Wi-Fi

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to enable Wi-Fi if Ethernet is not connected.  Hey, Scripting Guy! Most of the time when I use my laptop running Windows 8.1, I am plugged in to the Ethernet network at work. Occasionally, I unplug the laptop and take it to meetings. I keep the Wi-Fi disabled when I am plugged in to the Ethernet because if I have it enabled, it seems that at random times, my laptop connects to Wi-Fi. I only notice this when Outlook becomes really slow or I am trying to download something that ends up taking forever. I also think this is a ...

PowerTip: Use PowerShell to Verify Hotfix
Mar 22, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Verify Hotfix

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to verify if a hotfix is installed.  How can I use Windows PowerShell to verify that my workstation running Windows 8.1 has            the November DSC rollup installed?  Use the Get-Hotfix cmdlet and search for ID KB3000850: Get-HotFix -Id kb3000850

Weekend Scripter: Use PowerShell to Find Longest Cmdlet Name
Mar 22, 2015
Post comments count 0
Post likes count 0

Weekend Scripter: Use PowerShell to Find Longest Cmdlet Name

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find the longest cmdlet name. Microsoft Scripting Guy, Ed Wilson, is here. This is an exciting time of the year, as we get ready for the PowerShell Summit in Charlotte and for the Microsoft Ignite conference in Chicago. I have been having numerous email conversations with various individuals the past week. One of the fun exchanges took place with Windows PowerShell MVP and Honorary Scripting Guy, Sean Kearney. We are planning something cool for Ignite, and we were bouncing ideas around, for example, "I wonder which Windows P...

PowerTip: Use PowerShell to Count Types of Images
Mar 21, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Count Types of Images

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to count different types of image files.  How can I use Windows PowerShell to see a count of the different types of image files on my computer?  Use the Get-ChildItem cmdlet to find the image files and then pipe the results to the Group-Object cmdlet,            for example: dir -Recurse -ea 0 -File -path e:\data -include "*.gif","*.jpg", "*.png", "*.bmp" | group extension -NoElement Note  Dir is an alias for Get-ChildItem and Group is an alias...

PSImaging Part 3: Group-ImageFile
Mar 21, 2015
Post comments count 0
Post likes count 1

PSImaging Part 3: Group-ImageFile

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Ben Vierck, talks about grouping similar images with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we have Ben Vierck back for Part 3 in his series about images. Before you begin, you might like to read: In first two blog posts of this series, we wrote the Windows PowerShell functions Test-Image and Export-Text into a new Windows PowerShell module named PSImaging. The purpose of this exercise is to give us a set of common atomic tools that we can use to automate some of day-to-day document management tasks that require manual human intervention. Today we'r...

PowerTip: Use PowerShell to Count Images
Mar 20, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Count Images

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to count images.  How can I use Windows PowerShell to count images on a drive?  Use the Get-ChildItem cmdlet, specify the path, and send the results to the Measure-Object cmdlet,            for example: dir -Recurse -ea 0 -File -path e:\data -include "*.gif","*.jpg", "*.png", "*.bmp" | measure Note  Dir is an alias for Get-ChildItem and Measure is an alias for Measure-Object.

PSImaging Part 2: Export-Text from Images
Mar 20, 2015
Post comments count 1
Post likes count 0

PSImaging Part 2: Export-Text from Images

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Ben Vierck, talks about using Windows PowerShell to export text from an image. Microsoft Scripting Guy, Ed Wilson, is here. Welcome back guest blogger Ben Vierck, for Part 2 of PSImaging. Read Part 1 before diving into today’s post: PSImaging Part 1: Test-Image. Now, here’s Ben... In first blog post of this series, we wrote the Windows PowerShell function Test-Image to definitively detect whether a file is a known image type by analyzing the first 8 bits of its header. In this post, we're going to write a Windows PowerShell command with a cmdlet called Export-ImageText tha...

PowerTip: Read .exe Magic Number with PowerShell
Mar 19, 2015
Post comments count 0
Post likes count 0

PowerTip: Read .exe Magic Number with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to see an .exe magic number.  How can I use Windows PowerShell to see the "magic number" associated with an executable file in Windows?  The term magic number refers to the bytes that occur at the beginning of every file and identify the format of file.            Use this command to read a Windows executable file header with Windows PowerShell:  [char[]](gc $env:windir\notepad.exe -Encoding Byte -ReadCount 1 -TotalCount 2)

PSImaging Part 1: Test-Image
Mar 19, 2015
Post comments count 0
Post likes count 0

PSImaging Part 1: Test-Image

Doctor Scripto
Doctor Scripto

Summary: Guest blogger, Ben Vierck, talks about using Windows PowerShell to determine if a file is an image. Microsoft Scripting Guy, Ed Wilson, is here. I am happy to introduce a new guest blogger here at the Hey, Scripting Guy! Blog: Ben Vierck. Ben has been around for a while, using and supporting Windows PowerShell, and he certainly is not a noob by any stretch of the imagination. I had not previously talked to him about writing a guest blog, and then Teresa mentioned it to me. What would I do without the Scripting Wife? Let’s hope I don’t have to find out! Ben is presenting a three-part series ab...

PowerTip: Shut Down Virtual Machine with PowerShell
Mar 18, 2015
Post comments count 0
Post likes count 0

PowerTip: Shut Down Virtual Machine with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to shut down a virtual machine by using Windows PowerShell.  How can I use Windows PowerShell to perform an orderly shutdown of a virtual machine?  When the Stop-VM cmdlet is used with no parameters, it conducts an orderly shutdown.            Here is an example: Stop-VM –name C1

Update Offline Virtual Machine with PowerShell and WSUS Offline Update: Part 2
Mar 18, 2015
Post comments count 0
Post likes count 0

Update Offline Virtual Machine with PowerShell and WSUS Offline Update: Part 2

Doctor Scripto
Doctor Scripto

Summary: Microsoft PowerShell MVP, Sean Kearney, talks about updating an offline virtual machine with Windows PowerShell and WSUS Offline Update. Honorary Scripting Guy, Sean Kearney, here. Yesterday, I introduced you to a tool you can use to updating offline virtual machines: Update Offline Virtual Machine with PowerShell and WSUS Offline Update: Part 1. Today, we'll learn how to conclude our process. Within the folder structure is a folder called Client. This is the structure we need to expose to our offline virtual machines. The process we’re going to follow will be very simple: The followin...

PowerTip: Use PowerShell to Mount ISO
Mar 17, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Mount ISO

Doctor Scripto
Doctor Scripto

Summary: Easily mount ISO files by using Windows PowerShell.  How can I use Windows PowerShell to mount ISO files in Windows 8?  Use the Mount-Disk cmdlet and specify the exact path of the ISO file, for example: Mount-DiskImage C:\Media\Filename.ISO

Update Offline Virtual Machine with PowerShell and WSUS Offline Update: Part 1
Mar 17, 2015
Post comments count 0
Post likes count 0

Update Offline Virtual Machine with PowerShell and WSUS Offline Update: Part 1

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney introduces a cool tool for updating virtual machines.  Hey, Scripting Guy! I have some virtual machines that are normally offline. They need to be updated on a regular basis, but these machines have no access to the Windows Server Update Services (WSUS) server. Is there an easy answer to this problem? —WT  Hello WT, Honorary Scripting Guy, Sean Kearney, is here to show a little magic with Windows PowerShell and the Windows update system. Updating an offline virtual machine really isn’t that difficult. Just power it up, wait for the updates to dow...

PowerTip: Use PowerShell to Find Network Adapters
Mar 16, 2015
Post comments count 0
Post likes count 0

PowerTip: Use PowerShell to Find Network Adapters

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to find network adapters associated with running virtual machines.  How can I use Windows PowerShell to see the network adapters that are associated with all running            virtual machines on my Windows 8.1 laptop that runs Hyper-V?  Use the Get-VM cmdlet to look for running virtual machines. Then pipe the results to the            Get-VMNetworkAdapter cmdlet, for example: (Get-VM).where({$_.state -eq 'running'}) | Get-VMNetworkAdapter Note  This command must be run wi...

Updating Virtual Machines
Mar 16, 2015
Post comments count 0
Post likes count 0

Updating Virtual Machines

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about the problem of updating virtual machines. Microsoft Scripting Guy, Ed Wilson, is here. This afternoon I am sipping a nice cup of red berry tea. I also have a bowl of grapes and a bit of brie. The berry tea, grapes, and brie are a nice combination, and light enough that it makes a nice afternoon snack. One of the great things I love about Windows 8.1 is that it has real Hyper-V built-in to it, and it has Windows PowerShell cmdlet support for managing those virtual machines. The performance is really good, and it means that I can create a virtual machine...

PowerTip: Display the Value of Pi by Using PowerShell
Mar 14, 2015