Browse by Tags

Tagged Content List
  • Blog Post: Optimize PowerShell Code?

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about optimizing Windows PowerShell code. Microsoft Scripting Guy, Ed Wilson, is here. I was looking at my Windows Phone this morning and I noticed that today is Friday the 13 th . What seemed a bit strange to me is that I thought there was also...
  • Blog Post: Create Custom Date Formats with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about creating custom date formats with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the cool things about working with Windows PowerShell is that it is highly configurable. In short, if there is something that I do not...
  • Blog Post: Formatting Date Strings with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about formatting date strings with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. It seems that different ways to display dates and times are in great supply. In fact, there are dozens of ways to do this. If I decide that I do not...
  • Blog Post: Adding and Subtracting Dates with PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about adding and subtracting dates with Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. One of the things I really like about Windows PowerShell is the way it simplifies adding and subtracting from dates. For example, if I want to...
  • 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: Use PowerShell to Work with Individual Dates

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to work with dates. Microsoft Scripting Guy, Ed Wilson, is here. I don’t know about you, but one thing about my life as the Scripting Guy is that it keeps me busy. "Keeping busy" is a slang expression...
  • 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: Working with Dates in PowerShell

    Summary : Microsoft Scripting Guy, Ed Wilson, talks about the fundamentals of working with dates in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. For as long as I can remember, I have pretty much always hated working with dates and times. Back on my Osborne One, it was no fun. The...
  • 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: Weekend Scripter: Use PowerShell to Explore Dates

    Summary : Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to explore dates in the future. Microsoft Scripting Guy, Ed Wilson, is here. This afternoon, I am sipping a nice cup of Kwai Flower Organic Oolong tea. It is a slightly sweet, mild tea that goes well with jasmine blossoms...
  • Blog Post: Create a Proxy Function to Display Registry Key Time Stamps

    Summary : Guest blogger, Rohn Edwards, discusses creating a Windows PowerShell proxy function to display registry key time stamps. Microsoft Scripting Guy, Ed Wilson, is here. Happy New Year to you all. Guest blogger, Rohn Edwards, is back with us today to continue his series about retrieving registry...
  • Blog Post: Hey, Scripting Guy! Quick-Hits Friday: The Scripting Guys Respond to a Bunch of Questions (02/06/09)

    How Can I Pipe Over a Variable for Use in a File Name? Hey, Scripting Guy! Sorry to bother you but I have been looking for an answer to this for a few hours now. I’ve also been experimenting but have had no luck figuring it out yet. How do you get a variable to pipe over to use in a file name?...
  • Blog Post: How Can I Separate Hours and Minutes in a Date-Time Value?

    Hey, Scripting Guy! In determining system uptime I get back a value like 65.75 hours. How can I convert this value to "65 hours and 45 minutes"? -- JM Hey, JM. We’ll see what we can do for you, but we have to be honest: this is a very sad day for the Scripting Guys. Thanks to the baseball playoffs...
  • Blog Post: Expert Solution for 2011 Scripting Games Beginner Event 7: Use PowerShell to Get the Number of Days Between Dates

    Summary : Microsoft PFE, Michael Frommhold, uses Windows PowerShell to get the number of days between two dates as he solves Beginner Event 7 in one line of code. Microsoft Scripting Guy, Ed Wilson, here. Michael Frommhold is the author for the expert commentary on Beginner Event 7. Michael has been...
  • Blog Post: Use PowerShell to Convert Date Formats Easily

    Summary : Microsoft Scripting Guy Ed Wilson discusses four different techniques for using Windows PowerShell to convert date formats. Hey, Scripting Guy! I have a problem. Although I am sure you hear this a lot, this problem is causing me a major problem at work. Here is the deal. We are a large...
  • Blog Post: Hey, Scripting Guy! How Can I Incrementally Rename Files Based on the File Creation Date?

    Hey, Scripting Guy! I am trying to get my photos sorted in chronological order, even though – because they come from different cameras – they have different names. For example, one name type starts with DSC followed by a sequential number issued by one camera; another name type starts with IMG followed...
  • Blog Post: How Can I Change the Last Modified Timestamp for All the Files in a Folder?

    Hey, Scripting Guy! How can I change the last modified timestamp for all the files in a folder? I’d like the first file to have a specified timestamp, then each subsequent file to have a timestamp one minute later than the previous file. -- AF Hey, AF; glad to see that you’re taking a break from the...
  • Blog Post: Hey, Scripting Guy! How Can I Tell If a Time Occurred in the Morning or the Evening?

    Hey, Scripting Guy! Given a time of day, is there an easy way to tell whether that’s a morning time or an evening time? -- HG Hey, HG. Can you feel the excitement in the year, that sense of anticipation, the crackling energy and the flow of adrenalin? That can only mean one thing: the annual Turducken...
  • Blog Post: Expert Solution for 2011 Scripting Games Beginner Event 10: Use Easy PowerShell Code to Time Script Operations

    Summary : Microsoft PowerShell MVP Marco Shaw solves beginner event 10 in the 2011 Scripting Games and shows how to time script operations Microsoft Scripting Guy, Ed Wilson, here. Marco Shaw is the author of the expert commentary for Beginner Event 10 . Marco is a consultant with CGI in...
  • Blog Post: How Can I Subtract a Specified Number of Days from a UTC Value?

    Hey, Scripting Guy! Suppose I get a date-time value in UTC format. How can I subtract x number of days from that value? -- MW Hey, MW. First of all, we’d like to thank you for your question; in addition, we’d like to welcome you and everyone else to today’s Open House in honor of the 500 th Hey, Scripting...
  • Blog Post: The 2011 Scripting Games Beginner Event 7: Easily Determine Days Between Dates by Using PowerShell

    Summary : Beginner Event 7 uses Windows PowerShell to determine the number of days between dates. About this event Division Beginner Date of Event 4/12/2011 12:01 AM Due Date 4/19/2011 12:01 AM Event scenario ...
  • Blog Post: How Can I Determine the Date and Time that a Process Started?

    Hey, Scripting Guy! How can I determine the date and time that a process started? -- BM Hey, BM. We’ve got good news for you: not only do we have an answer to your question, but we’re not going to bore everyone with any more stories regarding our Colt League All-Star team. Nope, we’re no longer haunted...
  • Blog Post: How Can I Use Windows PowerShell to Report Back the Name and Creation Date for Files Containing a Specified String Value?

    Hey, Scripting Guy! Using Windows PowerShell, how can I search for a string value in all the files in a folder full of text files, then report back the file name and creation date for each file where that string value was found? Oh, and I’d like to have these files sorted by date, too. -- JS Hey,...
  • Blog Post: How Can I Determine Last Month’s Date?

    Hey, Scripting Guy! How can I determine last month’s date? I need to be able to take the month and year for the previous month (using the format mmyy ) and create a file name like this: test0606.xls. -- DR Hey, DR. We have to admit that, at first, this question posed a bit of a problem for the Scripting...
  • Blog Post: Hey, Scripting Guy! How Can I Retrieve Time Zone Information for a Computer?

    Hey, Scripting Guy! How can I retrieve time zone information for a computer? -- AL Hey, AL. You know, over the Thanksgiving Day weekend the Scripting Guy who writes this column took some time to think about his job, and to think of ways in which he could do that job even better. (Note to the Scripting...