Browse by Tags

Tagged Content List
  • Blog Post: PowerTip: Download Links from Webpage with PowerShell

    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"...
  • Blog Post: PowerTip: Find Most Recent Event Log Entry

    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
  • Blog Post: PowerTip: Use PowerShell to Check Logon Server for Client

    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...
  • Blog Post: PowerTip: Read File with Backtick in Name

    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...
  • Blog Post: PowerTip: Find PowerShell Variables Defined for AllScope

    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...
  • Blog Post: PowerTip: Open Temporary Copy of PowerShell Profile

    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...
  • Blog Post: PowerTip: Launch PowerShell Without a Profile

    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...
  • Blog Post: PowerTip: Create New PowerShell Profile for All Hosts

    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...
  • Blog Post: PowerTip: Determine if Running in PowerShell Console

    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...
  • Blog Post: PowerTip: Open Windows Explorer to a Location

    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...
  • Blog Post: PowerTip: Find Name and Location of PowerShell Profiles

    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...
  • Blog Post: PowerTip: Determine If You Have PowerShell Profile

    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
  • Blog Post: PowerTip: Find Tangent of 45-Degree Angle with PowerShell

    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)
  • Blog Post: PowerTip: Set Breakpoint Based on Command

    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...
  • Blog Post: PowerTip: Set PowerShell Breakpoint Based on Variable

    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...
  • Blog Post: PowerTip: Find All Disabled Breakpoints in PowerShell

    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 ($_...
  • Blog Post: PowerTip: Find References to Uninitialized Variables in PowerShell

    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...
  • Blog Post: PowerTip: Enable Script Tracing in PowerShell Functions

    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
  • Blog Post: PowerTip: Use Cmdlet to Trace Script Execution

    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
  • Blog Post: PowerTip: Find All Breakpoints in PowerShell Session

    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.
  • Blog Post: PowerTip: Use PowerShell to Get Disk Drive Overview

    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...
  • Blog Post: PowerTip: Use PowerShell to Get Unique List of Process Names

    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...
  • Blog Post: PowerTip: Use PowerShell to Obtain Unique List of Process Names

    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...
  • Blog Post: PowerTip: Determine Name of PowerShell Host

    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
  • Blog Post: PowerTip: Find Status of Range of Services with PowerShell

    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...