Browse by Tags

Tagged Content List
  • Blog Post: PowerTip: Round a Number with PowerShell

    Summary : Use Windows PowerShell to round numbers to a specific decimal place. How can I use Windows PowerShell to round a number to a specific number of decimal places, and continue to have a number instead of converting it to a string. Use the Round static method from the System.Math class. By...
  • Blog Post: PowerTip: Format Decimal Numbers in PowerShell

    Summary : Learn how to display a specific number of decimal points in Windows PowerShell. How can I use Windows PowerShell to display only one decimal place on a number that currently has two? Use a custom number format string with the ToString method from the number, for example: PS C:\>...
  • Blog Post: PowerTip: Use Parentheses to Override Operator Precedence

    Summary : Use parentheses to override operator precedence in Windows PowerShell. How can I ensure that a math expression that keeps returning incorrect information will work properly in Windows PowerShell? In Windows PowerShell (as in other languages), math operators have a precedence. Therefore...
  • Blog Post: PowerTip: Round Number Up or Down with PowerShell

    Summary : Easily use Windows PowerShell to round a number up or down. I want only a whole number returned, so I want the number rounded up or down as appropriate. How can I do this with Windows PowerShell? Cast the number as an integer, and Windows PowerShell will round the number up or down as...
  • Blog Post: PowerTip: Windows PowerShell Survival Guide

    Summary : Find the Windows PowerShell Survival Guide. Where can I find a community-based resource that links to all the essentials? Check out the Windows PowerShell Survival Guide on the TechNet Wiki. It contains links to dozens of Windows PowerShell resources.
  • Blog Post: PowerTip: View PowerShell Help Online

    Summary : View Windows PowerShell cmdlet Help online. How can I view Windows PowerShell Help in my web browser? The –Online parameter with the Get-Help cmdlet opens the latest online Windows PowerShell Help in your web browser, for example: Get-Help Get-Command -Online
  • Blog Post: PowerTip: Pipe String to Get-Date

    Summary : Pipe a string to the Windows PowerShell Get-Date cmdlet to convert it to a DateTime object. How can I use Windows PowerShell to convert a date that is in a string format to a DateTime object? Create a pipeline, for example: "11/14/2015" | get-date
  • Blog Post: PowerTip: Use PowerShell to Work with Active Directory Date Fields

    Summary : Use Windows PowerShell to work with Active Directory date fields. How can I Use Windows PowerShell to work with date fields in Active Directory? Try the following techniques: # Password last set within the last 30 days? $pwdLastSet = Get-ADUser Administrator -Properties pwdLastSet...
  • Blog Post: PowerTip: Use PowerShell to Display date Format for Specific Culture

    Summary : Learn how to use Windows PowerShell to display date formatting for a specific culture. How can I use Windows PowerShell to see the short date pattern for a specific culture without changing my UI culture settings? Use the CultureInfo class from System.Globalization, call the GetCultureInfo...
  • Blog Post: PowerTip: Use PowerShell to Display Format for Short Date

    Summary : Use Windows PowerShell to display the culture-specific format for a short date. How can I use Windows PowerShell to display the format of a short date that is specific to the culture settings of my system? Use the Get-Culture cmdlet and select the DateTimeFormat and ShortDatePattern properties...
  • Blog Post: PowerTip: Use PowerShell to Find Day of Week

    Summary : Learn how to use Windows PowerShell to find the day of the week. How can I use Windows PowerShell to find which day of the week a specific date will occur? Use the Get-Date cmdlet, and specify day, month, and year parameters, for example: Get-Date -Month 2 -Day 14 -Year 2015
  • Blog Post: PowerTip: Use PowerShell to Show Time

    Summary : Use Windows PowerShell to show the current time. How can I use Windows PowerShell to easily display only the current time? Use the Get-Date cmdlet and choose the Time display hint: Get-Date -DisplayHint Time
  • Blog Post: PowerTip: Test Connection to Remote Server

    Summary : Use Windows PowerShell to test the connection to a remote server. How can I test the connection in my server to see if I can run a remote Windows PowerShell command? Use the Test-WsMan cmdlet, for example: Test-WsMan –computername s1
  • Blog Post: PowerTip: Create XML Representation of Scheduled Task

    Summary : Learn how to export a scheduled task to XML by using Windows PowerShell. How can I use Windows PowerShell to create an XML representation of a scheduled task? Use the Get-ScheduledTask function and pipe the results to the Export-ScheduledTask function, for example: Get-ScheduledTask...
  • Blog Post: PowerTip: Use PowerShell to Delete Scheduled Task

    Summary : Use Windows PowerShell to delete a scheduled task. How can I use Windows PowerShell to delete a scheduled task? Use the Unregister-ScheduledTask function. By default, this command will prompt for confirmation. Therefore, if you want to use a Windows PowerShell script to remotely delete...
  • Blog Post: PowerTip: Use PowerShell to Enable Scheduled Task

    Summary : Use Windows PowerShell to enable a scheduled task. How can I use Windows PowerShell to enable a scheduled task? Use the Enable-ScheduledTask function from the Scheduled Task module, for example: Enable-ScheduledTask -TaskName applog Note This command uses the Scheduled Task module...
  • Blog Post: PowerTip: Use PowerShell to Disable Scheduled Task

    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 from the Scheduled Task module, for example: Disable-ScheduledTask -TaskName applog Note This cmdlet was introduced...
  • Blog Post: PowerTip: Find Scheduled Tasks with PowerShell

    Summary : Use Windows PowerShell to find the location of scheduled tasks. How can I use Windows PowerShell to easily look for scheduled tasks in the graphical tool? Use the Get-ScheduledTask cmdlet and search on the TaskPath property. Related scheduled tasks are grouped together and TaskPath provides...
  • Blog Post: PowerTip: Use PowerShell to Show "Ready" Scheduled Tasks

    Summary : Use Windows PowerShell to show all scheduled tasks that are ready to run. How can I use Windows PowerShell to find what scheduled tasks are ready to run on my system? Use the Get-ScheduledTask cmdlet, pipe the results to the Where-Object cmdlet, and filter on the state being ready, for...
  • Blog Post: PowerTip: Use PowerShell to Unblock Files in Folder

    Summary : Learn how to use Windows PowerShell to unblock files downloaded from the Internet. I downloaded a module from the Script Center Repository, and when I expanded and copied the files to my modules folder, I forgot to unblock them. Now every time I start Windows PowerShell, I get error messages...
  • Blog Post: PowerTip: Use PowerShell to Find Status of Scheduled Tasks

    Summary : Use Windows PowerShell to find the status of scheduled tasks. My laptop is acting strangely. Task Manager shows lots of processes running, but I have disabled everything I can see. How can I use Windows PowerShell to determine what scheduled tasks are running in the background? Use the...
  • Blog Post: PowerTip: Find Restore Points with PowerShell

    Summary : Learn how to use Windows PowerShell to find restore points. How can I use Windows PowerShell to find a list of restore points on my computers running Windows 8.1 or Windows 8? Use the Get-ComputerRestorePoint cmdlet. Notes Start the Windows PowerShell console with Administrator...
  • Blog Post: PowerTip: Find Related PowerShell Commands

    Summary : Learn how to find related Windows PowerShell commands. How can I find related commands in Windows PowerShell? Use the Get-Command cmdlet and sort by the ModuleName property. For example, to find commands that use the Get verb, use the following command: Get-Command –Verb get...
  • Blog Post: PowerTip: Find Time Zone Names with PowerShell

    Summary : Find time zone enumeration names with Windows PowerShell. How can I use Windows PowerShell to enumerate the names of time zones that are configured on my computer? Use the System.TimeZoneInfo .NET Framework class, and use the GetSystemTimeZones static method to obtain the list. You want...
  • Blog Post: PowerTip: Use PowerShell to Get All Computer Names

    Summary : Use Windows PowerShell to easily retrieve a list of all computer names on the network. How can I use Windows PowerShell to obtain a list of all the servers on the network so I can run a script against them without typing a bunch of names? Use the Get-ADComputer cmdlet from the Active...