Tag: PowerTip Page 1 of 5

PowerTip: Remove calendar events from a mailbox

Summary: Remove calendar events within an Exchange Online mailbox.

Hey, Scripting Guy! Question Is there an easy way to remove calendar events from within an Exchange Online mailbox?

Hey, Scripting Guy! AnswerYes there is. There is a newly deployed cmdlet to Office 365 tenants: Remove-CalendarEvents. …

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

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.

Hey, Scripting Guy! Question How can I list all the security patches that I’ve installed in the last …

PowerTip: Get a list of suspended Azure Automation jobs

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how get a list of all your suspended Azure Automation jobs.

Hey, Scripting Guy! Question I think I have an Azure Automation job that is getting suspended for running too long. How can I …

PowerTip: Convert from UTC to my local time zone

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how write a function to convert from UTC to your local time zone.

Hey, Scripting Guy! Question I have a time that I’d like to convert from UTC to my local time zone. How …

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

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.

Hey, Scripting Guy! Question Is there a way to find all the Azure Automation jobs that will run …

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

Summary: Use the Active Directory Module to get the information from the “Notes” field.

Hey, Scripting Guy! Question 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 …

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

Summary: Use the cmdlets provided in PowerShell 5.1 to manage local user accounts on a system.

Hey, Scripting Guy! Question I remember having to use the Active Directory Service Interfaces (ADSI) accelerator to access a list of local users in PowerShell. Is there …

PowerTip: Use PowerShell to determine active CIM sessions

Summary: Use the Common Information Model (CIM) cmdlets to pull a list of active sessions to remote workstations.

Hey, Scripting Guy! Question How can I find active CIM sessions on my workstation?

Hey, Scripting Guy! Answer Just use this one cmdlet to list all active CIM sessions, …

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

Summary: Use Active Directory cmdlets to identify locked-out user accounts and computer accounts.

Hey, Scripting Guy! Question Is there a quick and easy way to find all users who are locked out in Active Directory by using PowerShell?

 

Hey, Scripting Guy! Answer You’ll love this. The …

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

Summary: Use the new -depth parameter to control how far down a directory you can search.

Hey, Scripting Guy! Question I have a large file structure to search but I only want to go two folders deep on the search.  Is there a …

PowerTip: Capture the output of a Linux application in PowerShell

Summary: Use the built-in features of PowerShell to obtain data produced by a Linux application.

Hey, Scripting Guy! Question Can I run a Linux application like ls and capture its output in PowerShell?

Hey, Scripting Guy! Answer You certainly can!  It’s no different from when you normally …

PowerTip: Return a status code to Linux from PowerShell

Summary: Pass a result code back to a calling Linux environment from Open Source PowerShell.

Hey, Scripting Guy! Question How can I pass a numeric value back to a calling Bash Shell to indicate an error?

Hey, Scripting Guy! Answer Just simply supply the EXIT command and …

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

Summary: Identify the results of a script running in Open Source PowerShell in a Bash environment.

Hey, Scripting Guy! Question Is there any way to see the results of a PowerShell script? For example, if somebody sent an “Exit 42”, could I see …

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

Summary: Capture the status code of a PowerShell session in Linux or macOS.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer No …

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

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string by using a string instead of just a character.

Hey, Scripting Guy! Question I am trying to split the string “this is my amazing string” on the pattern “my” …

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

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string without losing the character you split on.

Hey, Scripting Guy! Question I’m splitting this file name some file.txt into its name and extension by going “some file.txt” –split “.”

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

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how use regex to detect if a string is a valid Active Directory user name.

Hey, Scripting Guy! Question The invalid characters for an Active Directory user name are /\[:;|=,+*?<>]\ and . How …

PowerTip: How to detect phone numbers using regular expressions

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to use regex to detect if a string is a phone number.

Hey, Scripting Guy! Question I have an array like $phoneornot = @('780-123-4567', '780 321 6548', 'notme', 'this is 2 num'), …

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

Summary: Cloud & Datacenter Management MVP, Thomas Rayner, shows how escape characters for use in regex.

Hey, Scripting Guy! Question Is there a way to escape characters in a string automatically for use in regex?

Hey, Scripting Guy! Answer Use the [regex]::escape() method to automatically escape characters …

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

Summary: Use PowerShell to pull out specify TimeZone data from an object.

Hey, Scripting Guy! Question 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 …

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

Summary: Use PowerShell and enumeration to access all possible colors that you can use in the console.

Hey, Scripting Guy! Question Is there a way to see all of the available colors that I can use when using Write-Host?

Hey, Scripting Guy! Answer We sure can! …

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

Summary: Use PowerShell to determine the value of an Extended ASCII character to reproduce it for later use.

Hey, Scripting Guy! Question I have a really simple question that’s been bugging me. I have a string with a special (Extended ASCII) character that …

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

Summary: Learn how to use PowerShell to remove a corporate user from all site collections in SharePoint Online.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly remove a corporate user from all site collections in SharePoint Online?

Hey, Scripting Guy! Answer Use the …

PowerTip: Find all devices connected to a computer

Summary: Use PowerShell to find all devices that are connected to a computer.

Hey, Scripting Guy! Question How can I use Windows PowerShell to list all devices that are connected to a computer?

Hey, Scripting Guy! Answer Use the Get-PnpDevice cmdlet and the -PresentOnly switch. Here is …

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

Summary: Use the Azure Resource Manager cmdlets to get the public IP address of an Azure virtual machine.

Hey, Scripting Guy! Question How can I get the public IP address information for an Azure Resource Manager virtual machine (VM)?

Hey, Scripting Guy! Answer All you need to …

PowerTip: Get a GUI interface for any PowerShell cmdlet

Summary: Use the Show-Command to build PowerShell cmdlets.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer You’ll love this …

PowerTip: List all available CIM classes by using PowerShell

Summary: Use the Get-CimClass cmdlet to see all classes that you can query from.

Hey, Scripting Guy! Question How can I find a list of Common Information Model (CIM) classes in Windows so that I can ask my computer useful questions?

Hey, Scripting Guy! Answer Just run …

PowerTip: List all subfolders under a target path with PowerShell

Summary: Use Get-Childitem to provide a printable list of all folders under a path.

Hey, Scripting Guy! Question 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 …

PowerTip: Use a destructive PowerShell cmdlet safely

Summary: Use the –whatif parameter with PowerShell cmdlets to test code live.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer No problem. You’re …

PowerTip: Remove trailing space from a string by using PowerShell

Summary: Use the trim() method to remove leading and trailing spaces from a string.

Hey, Scripting Guy! Question Could you do me a huge favor and show me how to get rid of spaces before and after a string in PowerShell?

Hey, Scripting Guy! Answer No problem …

PowerTip: Set the color of the progress bar with PowerShell

Summary: Use the $Host object to alter the color of the progress bar in PowerShell.

Hey, Scripting Guy! Question 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 …

PowerTip: Set a default value in a switch statement

Summary: Use the default field in switch statement to have an assumed value.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer Just …

PowerTip: Use PowerShell to identify a leap year

Summary: Use PowerShell and Math to identify a leap year.

Hey, Scripting Guy! Question Is there a way to use PowerShell to identify whether this year is a leap year?

Hey, Scripting Guy! Answer Actually there is! You can use a combination of Get-date to find out …

PowerTip: Extend a string array in PowerShell

Summary: Use the built in features of PowerShell to easily add new Element to a string array.

Hey, Scripting Guy! Question I created an array of strings in PowerShell, but I need to add to it. Is there a simple way to do …

PowerTip: Export Azure resource group as JSON by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to export a resource group as a JSON configuration.

Hey, Scripting Guy! Question I’ve heard that JSON is used to define features in Azure Resource Manager. Is there a way to export a resource group in …

PowerTip: Search Azure Resource Manager image publishers by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to search publishers for a match.

Hey, Scripting Guy! Question Could you show me an example of how to search through the list of publishers for Azure images?

Hey, Scripting Guy! Answer Just use the Get-AzureRMVMImagePublisher cmdlet, and filter on …

PowerTip: Change current Azure Resource Manager subscription by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to alter the current active subscription in use.

Hey, Scripting Guy! Question I have about a dozen different subscriptions in my Azure Resource Manager account. How can I change it from the default one to one …

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

Summary: Use the –format option in Get-Date to change the output.

Hey, Scripting Guy! Question 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 …

PowerTip: Find available virtual machine size by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to get the proper name for a virtual machine size.

Hey, Scripting Guy! Question Is there a way to see the proper name for a virtual machine size without creating a virtual machine first?

Hey, Scripting Guy! Answer Just use …

PowerTip: List all virtual network subnets by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to identify all the available subnets in a particular virtual network.

Hey, Scripting Guy! Question I’m trying to figure out a way to list all the subnet configurations in a virtual network in Azure Resource Manager. …

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

Summary: Use the Azure Resource Manager cmdlets to identify available storage accounts.

Hey, Scripting Guy! Question 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 …

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

Summary: Use the Azure Resource Manager cmdlets to show resources that are assigned under a resource group.

Hey, Scripting Guy! Question I looked at the console for Azure Resource Manager and can see all the resources for a particular resource group. Is there …

PowerTip: Get Azure Virtual Machine Diagnostics by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to retrieve diagnostic data within Azure Resource Manager virtual machines.

Hey, Scripting Guy! Question Our QA department was asking a very specific question that I didn’t know how to answer. Is there anything in an Azure …

PowerTip: Show Azure Resource Manager virtual machine status with PowerShell

Summary: Using the Azure Resource Manager cmdlets to see the running state of a virtual machine.

Hey, Scripting Guy! Question I remember using the old cmdlets for Azure, and they would show the status of my virtual machines.  How can I do that …

PowerTip: List Azure Resource Manager virtual networks with PowerShell

Summary: Use the AzureRM cmdlets to list all available virtual networks in a subscription.

Hey, Scripting Guy! Question 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 …

PowerTip: View properties from a storage account with PowerShell

Summary: View and access the SKU from a storage account for future use.

Hey, Scripting Guy! Question 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

PowerTip: Get all Azure Resource Manager resource groups with PowerShell

Summary: Using the AzureRM cmdlets to get a list of resource groups.

Hey, Scripting Guy! Question I have a client who has a large list of resource groups. Can you show me how to get a filtered list?

Hey, Scripting Guy! Answer Just use the Get-AzureRMResourceGroup cmdlet …

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

Summary: Use the Get-AzureRMSubscription cmdlet.

Hey, Scripting Guy! Question How can I see all of the available subscriptions when I am logged into Azure Resource Manager?

Hey, Scripting Guy! Answer Just run the Get-AzureRMSubscription cmdlet to get a complete list available to your UserID.

Get-AzureRMSubscription

PowerTip: Find a module in the PowerShell Gallery

Summary: Use the PowerShell Find module to search for modules.

Hey, Scripting Guy! Question I was trying to use the Find-module. Can you show me how to find all modules that have the word, Azure, in them?

Hey, Scripting Guy! Answer Just use a wildcard in the …

PowerTip: Specify that a script requires admin privileges to run

Summary: Learn how to require admin privileges to run a Windows PowerShell script.

Hey, Scripting Guy! Question How can I make sure that my Windows PowerShell script has administrator privileges to run?

Hey, Scripting Guy! Answer Use the #Requires directive and specify RunAsAdministrator. Here is an …

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

Summary: Use Windows PowerShell to display a percentage as a two place number.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display a number as a percentage that has two decimal places?

Hey, Scripting Guy! Answer Use the -f format specifier, and specify a …

PowerTip: Use a regular expression pattern to remove nonalphabetic characters

Summary: Learn how to use a regular expression pattern to remove nonalphabetic characters from a string by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to remove nonalphabetic characters from a string?

Hey, Scripting Guy! Answer To remove nonalphabetic characters from a …

PowerTip: Create a nested PowerShell custom object

Summary: Learn how to create a nested PowerShell custom object.

Hey, Scripting Guy! Question How do I create a nested PowerShell custom object to store layers (nested) of information?

Hey, Scripting Guy! Answer Use a hashtable with the PSCustomObject type accelerator, and specify PSCustomObject as the value …

PowerTip: Find your version of PowerShell

Summary: Learn how to find your Windows PowerShell version easily.

Hey, Scripting Guy! Question How can I use Windows PowerShell to tell me what version of Windows PowerShell I am running?

Hey, Scripting Guy! Answer Use the $PsVersionTable automatic variable. To see the major, minor, build, and …

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

Summary: Learn how to use Windows PowerShell to configure BranchCache to run in local caching mode.

Hey, Scripting Guy! Question How can I use Windows PowerShell to configure BranchCache to run in local caching mode?

Hey, Scripting Guy! Answer Open Windows PowerShell in an elevated prompt, and …

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

Summary: Learn how to configure a client to listen for content discovery requests even when running on battery with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to configure a client to listen for content discovery requests even when …

PowerTip: Use PowerShell to dismount a disk image

Summary:  Learn how to use Windows PowerShell to dismount a virtual disk or ISO.

Hey, Scripting Guy! Question How can I use Windows PowerShell to dismount a virtual disk?

Hey, Scripting Guy! Answer Use the Dismount-DiskImage cmdlet. It will dismount either an ISO or a virtual hard …

PowerTip: Use PowerShell to disconnect virtual disk

Summary: Learn how to use Windows PowerShell to disconnect from a virtual disk.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disconnect from a virtual disk?

Hey, Scripting Guy! Answer Use the Disconnect-VirtualDisk cmdlet and specify the friendly name, for example:

Disconnect-VirtualDisk -FriendlyName VirtualDisk01…

PowerTip: Disconnect sessions to ISCSI target with PowerShell

Summary: Learn how to disconnect sessions to a specified ISCSI target with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disconnect sessions to a ISCSI target object?

Hey, Scripting Guy! Answer Use the Get-ISCSITarget cmdlet to retrieve the target, and then supply …

PowerTip: Enable and disable ODBC performance counter settings with PowerShell

Summary: Learn how to enable and disable a collection of ODBC performance counter settings for troubleshooting.

Hey, Scripting Guy! Question How can I use Windows PowerShell to enable the ODBC performance counters, run commands in a script, and then disable the counters?

Hey, Scripting Guy! Answer You …

PowerTip: Enable PerfMon counters for ODBC connection pooling with PowerShell

Summary: Learn how to use Windows PowerShell to enable Windows Performance Monitor counters for ODBC connection pooling.

Hey, Scripting Guy! Question How can I use Windows PowerShell to enable Windows Performance Monitor (PerfMon) counters so I can troubleshoot Open Database Connectivity (ODBC) connection …

PowerTip: Use PowerShell to disable constrained delegation

Summary: Learn how to use Windows PowerShell to disable constrained delegation.

Hey, Scripting Guy! Question 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?

Hey, Scripting Guy! Answer Use the …

PowerTip: Use PowerShell to disable all scheduled tasks in folder

Summary: Use Windows PowerShell to disable all scheduled tasks in a specific folder.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disable all scheduled tasks in a particular folder?

Hey, Scripting Guy! Answer Use the Get-ScheduledTask cmdlet to enumerate the scheduled tasks in the …

PowerTip: Use PowerShell to disable scheduled task

Summary: Learn how to use Windows PowerShell to disable a scheduled task.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disable a scheduled task?

Hey, Scripting Guy! Answer Use the Disable-ScheduledTask cmdlet and specify the task name, for example:

Disable-ScheduledTask -TaskName “SystemScan”

PowerTip: Disable plug and play device with PowerShell

Summary: Learn how to disable a plug and play device with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to disable a plug and play device?

Hey, Scripting Guy! Answer Use the Disable-PNPDevice cmdlet and specify the instance ID, for example:

Disable-PnpDevice -InstanceID  …

PowerTip: Find DSC resources with PowerShell

Summary: Learn how to find DSC resources with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find DSC resources that are available in the PowerShell Gallery?

Hey, Scripting Guy! Answer Use the Find-DSCResource command.

 …

PowerTip: Use PowerShell to find configured repositories

Summary: Learn how to find all registered repositories for the current user in Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display Windows PowerShell repositories that I have configured for my user account?

Hey, Scripting Guy! Answer The Get-PSRepository cmdlet automatically shows …

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

Summary: Learn how to find modules that were installed by the Windows PowerShell Get command.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find modules that have been installed by the Get command?

Hey, Scripting Guy! Answer Use the Get-InstalledModule command.

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

Summary: Learn how to add a Hyper-V virtual switch as a filter for a remote packet capture session.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add a Hyper-V Virtual switch as a provider for a remote packet capture session?…

PowerTip: Add virtual network adapter to packet capture session

Summary: Learn how to use Windows PowerShell to add a virtual network adapter to a network packet capture session.
Hey, Scripting Guy! Question How can I use Windows PowerShell to add a virtual network adapter to a network packet capture session?

Hey, Scripting Guy! Answer Use the …

PowerTip: Install module from PowerShell Gallery

Summary: Learn how to install a module from the PowerShell Gallery.

Hey, Scripting Guy! Question How can I easily install a module from the PowerShell Gallery?

Hey, Scripting Guy! Answer Use the Install-Module cmdlet in Windows PowerShell 5.0, and specify the name of the module.

PowerTip: Learn about PowerShell default parameter values

Summary: Learn about the default parameter values in Windows PowerShell.

Hey, Scripting Guy! Question How can I find more about default parameter values in Windows PowerShell?

Hey, Scripting Guy! Answer Use the Get-Help cmdlet and search for *defaultParameter*. The following command returns a
      …

PowerTip: Get password from PowerShell credential object

Summary: Learn how to retrieve the password from a Windows PowerShell credential object.

Hey, Scripting Guy! Question I am having a problem connecting to an application via Windows PowerShell. How can I verify the user name and
           password …

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

Summary: Learn how to view properties and the associated values of those properties of .NET Framework classes with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to view the properties and their values from a .NET Framework class,
  …

PowerTip: Find properties of .NET Framework class with PowerShell

Summary: Learn how to use Windows PowerShell to display properties of a .NET Framework class.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily display properties of a .NET Framework class?

Hey, Scripting Guy! Answer Pipe the type accelerator to the Get-Member cmdlet and …

PowerTip: Find information about .NET Framework method with PowerShell

Summary: Learn how to use Windows PowerShell to find information about a .NET framework method.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find basic information about a particular .NET Framework method?

Hey, Scripting Guy! Answer Use the GetMethod method from the class, for …

PowerTip: Return remainder after dividing two numbers

Summary: Use Windows PowerShell to return the remainder after dividing two numbers.

Hey, Scripting Guy! Question How can use Windows PowerShell to divide two numbers and only return the remainder (called a modulo operation)?

Hey, Scripting Guy! Answer In Windows PowerShell, the modulo operator is the …

PowerTip: Add number to existing variable value

Summary: Learn how to easily add a number to an existing value stored in a variable and update the value of the variable.

Hey, Scripting Guy! Question How can I use Windows PowerShell to add a number to a value stored in a …

PowerTip: Use PowerShell to create repeating letters

Summary: Learn how to easily create duplicate letters by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily create a specific number of letters in a repetitive fashion?

Hey, Scripting Guy! Answer To create repetitive letters, all you need to do …

PowerTip: Import colon-delimited file with PowerShell

Summary: Learn how to use Windows PowerShell to import a file that uses a colon as a delimiter.

Hey, Scripting Guy! Question How can I use Windows PowerShell to import a file that is delimited with a colon instead of a comma?

Hey, Scripting Guy! Answer Use …

PowerTip: Find running services with PowerShell

Summary: Use Windows PowerShell to find running services.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly produce a sortable list of running services on my computer?

Hey, Scripting Guy! Answer Use the Get-Service cmdlet to return the services, and the Out-GridView to produce …

PowerTip: Find disk status with PowerShell and Windows 10

Summary: Use Windows PowerShell in Windows 10 to find disk status.

Hey, Scripting Guy! Question 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 …

PowerTip: Create list of approved PowerShell verbs

Summary: Learn how to easily produce a list of approved Windows PowerShell verbs.

Hey, Scripting Guy! Question How can I find what verbs are approved for use in a Windows PowerShell function?

Hey, Scripting Guy! Answer Use the Get-Verb cmdlet, and to make it easy to peruse, …

PowerTip: Find single-name PowerShell functions

Summary: Learn how to find Windows PowerShell functions that do not have a hyphen in the name.

Hey, Scripting Guy! Question How can I easily find Windows PowerShell functions that do not have a hyphen in the name, but instead are single words, …

PowerTip: Use PowerShell to return first two lines of file

Summary: Learn how to use Windows PowerShell to return the first two lines of a text file.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily return the first two lines of a text file?

Hey, Scripting Guy! Answer Use the Get-Content cmdlet and …

PowerTip: Find related cmdlet aliases

Summary: Learn how to find aliases related to a series of cmdlets.

Hey, Scripting Guy! Question How can I find aliases that are related to a series of Windows PowerShell cmdlets, such as processes?

Hey, Scripting Guy! Answer Use the Get-Alias cmdlet and specify a wildcard character …

PowerTip: Find cmdlets and functions related to DSC

Summary: Use Windows PowerShell to find cmdlets and functions related to Desired State Configuration.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly find a list of cmdlets and functions related to
           Desired State Configuration …

PowerTip: Find Amount of Time Between Two Dates

Summary: Learn how to use Windows PowerShell to find the amount of time between two dates.

Hey, Scripting Guy! Question How can I use Windows PowerShell to determin how many days until
            Windows PowerShell Saturday on March

PowerTip: Find Processes by Using Wildcard Characters

Summary: Learn how to use wildcard characters and Windows PowerShell to find processes.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily see all processes that contain the letters SV in the process name?

Hey, Scripting Guy! Answer Use the Get-Process cmdlet and a …

PowerTip: Use PowerShell to Find Command Line of Processes

Summary: Learn how to use Windows PowerShell to find the command line of processes.

Hey, Scripting Guy! Question How can I find the command line that was used to launch a process that is running on my system?

Hey, Scripting Guy! Answer Use the Get-CimInstance cmdlet, the …

PowerTip: Find PowerShell Cmdlets that Work with CSVs

Summary: Learn how to find Windows PowerShell cmdlets that work with CSVs.

Hey, Scripting Guy! Question How can I find Windows PowerShell cmdlets that I can use to work with a CSV file?

Hey, Scripting Guy! Answer Use the Get-Command cmdlet and look for cmdlets that have …

PowerTip: Find Help about PowerShell Pipelines

Summary: Learn how to find Windows PowerShell Help about pipelines.

Hey, Scripting Guy! Question How can I find information so that I can read about Windows PowerShell pipelines?

Hey, Scripting Guy! Answer Use the Get-Help cmdlet, specify the category of HelpFile, then type the word pipeline

PowerTip: Find List of PowerShell Functions

Summary: Easily find a list of Windows PowerShell functions.

Hey, Scripting Guy! Question How can I produce a list of the Windows PowerShell functions that are currently available?

Hey, Scripting Guy! Answer Use the Function PS Drive and the Get-ChildItem cmdlet:

Get-ChildItem function:

PowerTip: Identify PowerShell Version

Summary: Learn how to easily find the version of Windows PowerShell, CLR, and WSMan.

Hey, Scripting Guy! Question How can I use Windows PowerShell to identify the version of Windows PowerShell that is running on my system?

Hey, Scripting Guy! Answer Use the $PSversionTable automatic variable (you …

PowerTip: Use PowerShell to Perform Case-Sensitive Comparison

Summary: Learn how to perform a case-sensitive comparison in Windows PowerShell.

Hey, Scripting Guy! Question I need to compare two strings while taking case sensitivity into account. I try using -eq, but it does not work.
            …

PowerTip: Check PowerShell Scripts Against Rules

Summary: Learn how to easily check your Windows PowerShell scripts against various rules.

Hey, Scripting Guy! Question How can I quickly check my Windows PowerShell scripts with preconfigured rules?

Hey, Scripting Guy! Answer Download the latest version of the Script Analyzer from the Microsoft PowerShell Gallery: PSScriptAnalyzer

PowerTip: Automatically Enable PowerShell ISE Toolbar

Summary: Ensure that the Windows PowerShell ISE toolbar is always enabled.

Hey, Scripting Guy! Question How can I use Windows PowerShell to turn on the ISE toolbar?

Hey, Scripting Guy! Answer Turn on the toolbar with the following command:

$psISE.Options.ShowToolBar=$True

To turn it off, change the value …

PowerTip: List All Files Open in PowerShell ISE

Summary: Get a list of all files that are currently open in the Windows PowerShell ISE.

Hey, Scripting Guy! Question How can I pull a list of anything that I am currently editing in the Windows PowerShell ISE?

Hey, Scripting Guy! Answer Use this command to get …

PowerTip: Determine Which Files in ISE Are Saved

Summary: Easily identify which files have been saved in the PowerShell ISE.

Hey, Scripting Guy! Question How can I see which of my open files in the Windows PowerShell ISE been saved?

Hey, Scripting Guy! Answer To show a list of files that have been saved, run …

PowerTip: Set Zoom Level in PowerShell ISE

Summary: Automatically set the zoom level in the Windows PowerShell ISE.

Hey, Scripting Guy! Question How can I programmatically adjust the zoom for my font size in the Windows PowerShell ISE?

Hey, Scripting Guy! Answer Set the Zoom property—for example, to adjust the font to 150%, run:…