Browse by Tags

Tagged Content List
  • Blog Post: Use PoshUSNJournal Module to Work with Change Journal

    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...
  • Blog Post: PowerTip: View All Available Modules

    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
  • Blog Post: View Entries in USN Change Journal

    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...
  • Blog Post: PowerTip: Determine if PowerShell is Running x86 or x64

    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"} }
  • Blog Post: Connect to USN Change Journal

    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...
  • Blog Post: PowerTip: Use PowerShell to List Exported Types

    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 {} }
  • Blog Post: Use the PowerShell Debugger

    Summary : Boe Prox shows how to debug scripts in Windows PowerShell. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. This is the final part in a series of five posts about troubleshooting Windows PowerShell scripts and functions...
  • Blog Post: PowerTip: Create Self-Updating Variable

    Summary : Learn how to create a self-updating variable. How can I create a variable that will automatically update when I call it? Use Set-PSBreakPoint to set a variable that will always have the current date and time (or only time): Set-PSBreakpoint -Variable Time -Mode Read -Action {$Global...
  • Blog Post: Trace Your Commands by Using Trace-Command

    Summary : Boe Prox uses Trace-Command to understand commands. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. This is the fourth part in a series of five posts about troubleshooting PowerShell scripts/functions. The series includes...
  • Blog Post: PowerTip: Use PowerShell to View Trace Sources

    Summary : Use Windows PowerShell to view all trace sources. How can I use Windows PowerShell to see all available trace sources? Use Get-TraceSource cmdlet: Get-TraceSource | Select Name, Description PS C:\> get-tracesource | Select Name, Description Name Description ---- ---...
  • Blog Post: Enforce Better Script Practices by Using Set-StrictMode

    Summary : Boe Prox shows how to use Set-StrictMode to write better scripts. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. This is the third part in a series of five posts about troubleshooting Windows PowerShell scripts and...
  • Blog Post: PowerTip: Use PowerShell to Hide Parameter From IntelliSense

    Summary : Learn how to use Windows PowerShell to hide a parameter from IntelliSense. How can I use Windows PowerShell to hide a parameter from IntelliSense? Introduced in Windows PowerShell 4.0, you can specify the DontShow attribute for the [parameter()] type to hide that parameter from IntelliSense...
  • Blog Post: Troubleshoot by Using Set-PSDebug

    Summary : Boe Prox uses the Set-PSDebug cmdlet to assist in troubleshooting. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. This is the second part in a series of five posts about troubleshooting Windows PowerShell scripts...
  • Blog Post: PowerTip: Use PowerShell to Remove an Item from an Array

    Summary : Use Windows PowerShell remove an item from an array. How can I remove an item from an array? Use the ArrayList class, which has the Remove() method (instead of using System.Array , which does not have this method): PS > $ArrayList = New-Object System.Collections.ArrayList PS...
  • Blog Post: Provide Support by Using Verbose and Debug Streams

    Summary : Provide code support by using Verbose and Debug streams. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox, here today filling in for my good friend, The Scripting Guy. This is the first part in a series of five posts about troubleshooting Windows PowerShell scripts and functions...
  • Blog Post: PowerTip: Avoid Prompt When Using –Debug

    Summary : Boe Prox shows how to avoid being prompted when using –Debug . I love using –Debug in functions to figure out what is going on, but how can I avoid being prompted each time I run into Write-Debug in my code? After you declare your parameters, check for –Debug , and set...
  • Blog Post: What It Means to Be a PowerShell MVP

    Summary : Four Windows PowerShell MVPs share what the title means to them. Microsoft Scripting Guy, Ed Wilson, is here. The MVP Summit is over. Many MVPs began their long trek home last night. Others decided to remain overnight or even over the weekend before heading home. From the feedback I have...
  • Blog Post: PowerTip: View All Values of an Enum

    Summary : Boe Prox shows how to view all values of an enum. How can I view all of the available values of an enum? Use the [ Enum]::GetNames() method, for example: PS C:\ > [Enum]::GetNames([System.ConsoleColor]) Black DarkBlue DarkGreen DarkCyan DarkRed DarkMagenta DarkYellow...
  • Blog Post: Getting to Know ForEach and ForEach-Object

    Summary : Learn the differences between ForEach and ForEach-Object in Windows PowerShell. Honorary Scripting Guy and Windows PowerShell MVP, Boe Prox , here today filling in for my good friend, The Scripting Guy. Today I am going to talk about some differences between using ForEach and using ForEach...
  • Blog Post: PowerTip: Use PowerShell to Locate the Help File You Need

    Summary : Learn how to use Windows PowerShell to find the Help file you need. How can I figure out the exact name of the Help file that I am looking for about sessions? Use a wildcard character with Get-Help to narrow down the scope of the Help files: Get-Help about_*session* Name Category...
  • Blog Post: Weekend Scripter: Build a Clock Widget by Using PowerShell and WPF

    Summary : Boe Prox shows how to use Windows PowerShell to build a clock widget. Honorary Scripting Guy, Boe Prox, here today filling in for my good friend, The Scripting Guy. Here's a bit about me: Boe Prox is a Microsoft MVP in Windows PowerShell and a senior Windows system administrator....
  • Blog Post: PowerTip: Use PowerShell to Display Known Colors

    Summary : Boe Prox shows how to find all known colors on your computer. How can I use Windows PowerShell to find known colors on my computer and their hex representations? Use the Add-Type cmdlet as follows: Add-Type –assemblyName PresentationFramework [windows.media.colors] | Get-Member...
  • Blog Post: Build a Tool that Uses Constrained PowerShell Endpoint

    Summary : Boe Prox shows how to create a tool that can leverage a remote constrained endpoint to perform a task. Hey, Scripting Guy! How can I create a tool that my Help Desk admins can use to audit and restart services, while limiting their access to the server? —TJ Hello SH, Honorary...
  • Blog Post: PowerTip: Use PowerShell to Display Pop-Up Window

    Summary : Learn how to display a pop-up window by using Windows PowerShell. How can I use Windows PowerShell to display a pop-up window to a user when a script or function has completed? There are several ways to display a pop-up window, but the following command doesn’t require loading assemblies...
  • Blog Post: Use Delegated Administration and Proxy Functions

    Summary : Boe Prox shows how to create a secure PSSession endpoint by using delegated administration and a proxy function. Hey, Scripting Guy! There are some great things that I can do with a constrained Windows PowerShell endpoint. But I want to allow a user (who may not have the necessary rights...