Browse by Tags

Tagged Content List
  • Blog Post: Access Objects Inside Other Objects in PowerShell Pipeline

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about accessing objects inside other objects in the Windows PowerShell pipeline. Hey, Scripting Guy! Yesterday in Create Custom PowerShell Objects , you talked about writing a script to access embedded objects. That seems like a lot of trouble. Is...
  • Blog Post: PowerTip: Convert String into DateTime Object

    Summary : Use Windows PowerShell to convert a string into a DateTime object. How can I use Windows PowerShell to easily create a System.DateTime object from a string? Use the [DateTime] type accelerator to convert the string, for example: [datetime]"1/2/14"
  • Blog Post: Create Custom PowerShell Objects

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about creating custom objects via Windows PowerShell. Hey, Scripting Guy! Yesterday in Understand Embedded Objects in PowerShell , you said the easy way to expand a Windows PowerShell object was to use the –ExpandProperty parameter from the...
  • Blog Post: PowerTip: Create Custom PowerShell Objects

    Summary : Learn about the easiest way to create a custom Windows PowerShell object. How can I easily create a custom object that contains only a few of the existing properties of a Windows PowerShell cmdlet? Use the Select-Object cmdlet in the pipeline and choose the properties you want to add...
  • Blog Post: Understand Embedded Objects in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about understanding embedded objects in Windows PowerShell. Hey, Scripting Guy! I don’t get it. Some things in Windows PowerShell are so easy, and others are so complicated. It seems to go from ridiculously easy to ridiculously hard all at...
  • Blog Post: PowerTip: Expand Objects in PowerShell

    Summary : Learn how to easily expand objects in Windows PowerShell. How can I expand an object that was returned by my Windows PowerShell expression? Use the –ExpandProperty parameter from Select-Object to expand objects in Windows PowerShell. This example expands the System.Diagnostics.ProcessStartInfo...
  • Blog Post: Use PowerShell to Find Hotfixes Installed in Time Range

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find hotfixes that were installed during a certain time range. Hey, Scripting Guy! I have a problem at work. It seems there was a hotfix that was installed in the last couple of months that is causing problems...
  • Blog Post: PowerTip: Programmatically Open Script in PowerShell ISE

    Summary : Use Windows PowerShell to open a script in the Windows PowerShell ISE. How can I use Windows PowerShell to run a script that will open another script in a new tab in the Windows PowerShell ISE? Use the CurrentPowerShellTab Files Add method from the $psISE object, for example: $psISE...
  • Blog Post: Start Virtual Machines in Order and Wait for Stabilization

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using a Windows PowerShell workflow to ensure that virtual machines start in order and stabilize. Microsoft Scripting Guy, Ed Wilson, is here. Last month, I wrote the following blog post: Use PowerShell to Start or Stop Virtual Machines in...
  • Blog Post: PowerTip: Require Specific Module in PowerShell Script

    Summary : Learn how to require a specific module in a Windows PowerShell script. How can I prevent a Windows PowerShell script from running if it requires the Active Directory module and the module is not available? At first line of the script, use the #Requires statement to require the Active...
  • Blog Post: Use PowerShell for an Easy Shutdown

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to perform an easy shutdown. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I do with Windows PowerShell is to automate repetitive tasks. It may sound rather obvious, but I can assure you it is not....
  • Blog Post: PowerTip: Find PowerShell Cmdlets Supplied by Module

    Summary : Find Windows PowerShell cmdlets that are supplied by a specific module. How can I easily see all the cmdlets that ship with the Hyper-V module.? Use the Get-Command cmdlet, and specify the Hyper-V module. (Tab expansion works for module names, which is great because who can remember if...
  • Blog Post: Weekend Scripter: Create PowerShell Graphical Help Function

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about creating a graphical Help function in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Well, I should have known. In yesterday’s post, A Graphical Tool to Explore PowerShell Help , I said it would not take too long to...
  • Blog Post: PowerTip: Cause Out-GridView Cmdlet to Pause

    Summary : Use Windows PowerShell to pause the script while the Out-GridView displays. How can I pause the execution of my Windows PowerShell script while the Out-GridView cmdlet displays a grid view? (I do not need to pass information from the grid to the script.) The –Wait parameter from...
  • Blog Post: Weekend Scripter: A Graphical Tool to Explore PowerShell Help

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to explore Help topics. Microsoft Scripting Guy, Ed Wilson, is here. With the drops of the Windows Management Framework 5.0 (also known as Windows PowerShell 5.0), now is a good time to begin exploring modules, new...
  • Blog Post: PowerTip: Use PowerShell Out-GridView to Explore Cmdlets

    Summary : Use the Windows PowerShell Out-GridView cmdlet to aid in exploring cmdlets. How can I use Windows PowerShell to graphically explore cmdlets provided by the Hyper-V module and filter by verb? Use the Get-Command cmdlet and specify the Hyper-V module. Select the name, verb, noun, and definition...
  • Blog Post: Use a PowerShell Function to Determine Miles to Go

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about a Windows PowerShell function to determine miles remaining to meet challenge. Microsoft Scripting Guy, Ed Wilson, is here. If you are friends with me on Facebook, you know that in October I accepted a challenge to run a hundred miles before...
  • Blog Post: PowerTip: Replace Multiple Words in String with PowerShell

    Summary : Use Windows PowerShell to replace multiple words in a string. How can I use Windows PowerShell to replace misspelled words in a string? Use the –Replace operator, for example: $s = "The calander says there are five calendar days left in the callander" $s -replace...
  • Blog Post: Use PowerShell and WMI to Explore Threads

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell and WMI to explore processes and threads. Hey, Scripting Guy! I need to find information about threads that are related to a specific process. I am wondering how I can do this by using Windows PowerShell. Can you help...
  • Blog Post: PowerTip: Use CIM and PowerShell to Find WMI Classes

    Summary : Use CIM and Windows PowerShell to find WMI classes related to threads. How can I use Windows PowerShell to easily find WMI classes that are related to threads? Use the Get-CimClass cmdlet, and specify a wildcard character for threads: Get-CimClass *thread*
  • Blog Post: Use PowerShell to Get BIOS Information on Remote Servers

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to retrieve BIOS information from remote servers. Hey, Scripting Guy! I really hope you can help me. I need to get a list of basic BIOS information from our servers. All of the servers that I need are listed in a single...
  • Blog Post: PowerTip: Use PowerShell to Determine Weeks Between Dates

    Summary : Use Windows PowerShell to determine the number of weeks between two dates. I have a project that is broken into several major components of work. I know the start date of the project and the end date of the project. How can I use Windows PowerShell to determine the number of weeks between...
  • Blog Post: Pre- and Post-Incrementing Do...While Loop in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about pre- and post-incrementing the Do...While loop in Windows PowerShell. Hey, Scripting Guy! I think that I found a bug in Windows PowerShell. In fact, I am pretty sure that I have. It involves using the ++ increment operator. For example, I know...
  • Blog Post: PowerTip: Zoom the PowerShell ISE

    Summary : Use a Windows PowerShell command to increase zoom in the Windows PowerShell ISE. How can I increase the zoom level in a script that I use to set up the Windows PowerShell ISE before presentations? Use the $host object and the PrivateData object, and set the zoom size to greater than 100...
  • Blog Post: Weekend Scripter: Count Images with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, counts the images he used in Hey, Scripting Guy! Blog posts through the years. Microsoft Scripting Guy, Ed Wilson, is here. I have been writing the Hey, Scripting Guy! Blog for a while…actually, quite a while. It is the best job I have ever had—and...