{"id":13381,"date":"2011-07-08T00:01:00","date_gmt":"2011-07-08T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/07\/08\/use-powershell-to-get-the-number-of-the-week-of-the-year\/"},"modified":"2011-07-08T00:01:00","modified_gmt":"2011-07-08T00:01:00","slug":"use-powershell-to-get-the-number-of-the-week-of-the-year","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-get-the-number-of-the-week-of-the-year\/","title":{"rendered":"Use PowerShell to Get the Number of the Week of the Year"},"content":{"rendered":"<p><b>Summary<\/b>: Learn how to use Windows PowerShell to easily get the number of the week of the year.<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. It seems that at times things appear to be too hard. At other times, things that I figure might be too hard, end up being super simple. I guess this is why I was never that good at project estimation tasks. A case in point is the solar collector that I decided to build for our swimming pool. The first task is to build the frame to support the collectors, then it needs a little plumbing to tie it into the pool. I figured the entire task could be accomplished in one weekend. Six weeks later, the frame itself is not even completed&mdash;and that is with Dr. Scripto&rsquo;s help. The frame and Dr. Scripto appear in the following photo.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1643.HSG-7-8-11-01_3DE0F0C8.jpg\"><img decoding=\"async\" height=\"304\" width=\"404\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7127.HSG-7-8-11-01_thumb_03F1ADDC.jpg\" alt=\"Photo of solar frame\" border=\"0\" title=\"Photo of solar frame\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" \/><\/a><\/p>\n<p>Today I decided that I needed to know the number of the week of the year. For example, is this the 23<sup>rd<\/sup> week of the year or what? The reason is that I am trying to be 30 days ahead with the Hey! Scripting Guy Blog by the time that December rolls around. Because I publish a new blog every single day, it means that if I want to take a week off, I need to be at least 10 days ahead. This is because I do not like to write, edit, and publish a blog all in the same day. Plus the fact that when I come back from a week of vacation, it takes several days just to get caught up on meeting requests, email, and phone messages. Therefore, I do not want to worry about a Hey! Scripting Guy blog as well when I return from a holiday. <\/p>\n<p>So with all the normal days off in December and in January, coupled with taking a couple weeks of holiday with the Scripting Wife, I always like to be 30 days ahead by the time that December 1 rolls around. This buffer also gives me time to begin working on Scripting Games events, which takes an awful lot of work as well. <\/p>\n<p>At first I figured that I should be able to get the week of the year by using <b>Get-Date<\/b>. I knew there was the <b>DayOfYear<\/b> property, so I figured there might be a <b>WeekOfYear<\/b> property as well. Unfortunately, such was not the case. The <b>Get-Member<\/b> command and its associated output are shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; get-date | gm<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;&nbsp; <\/span><\/span><span>TypeName: System.DateTime<\/span><\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>MemberType<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Definition<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;-<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Add<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime Add(System.TimeSpan value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddDays<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddDays(double value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddHours<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddHours(double value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddMilliseconds<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddMilliseconds(double value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddMinutes<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddMinutes(double value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddMonths<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddMonths(int months)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddSeconds<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddSeconds(double value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddTicks<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddTicks(long value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">AddYears<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime AddYears(int value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">CompareTo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>int CompareTo(System.Object value), int CompareTo(System.DateTime value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Equals<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>bool Equals(System.Object value), bool Equals(System.DateTime value)<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">GetDateTimeFormats<span>&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string[] GetDateTimeFormats(), string[] GetDateTimeFormats(System.IFormatProvide&#8230;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">GetHashCode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>int GetHashCode()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">GetType<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>type GetType()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">GetTypeCode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.TypeCode GetTypeCode()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">IsDaylightSavingTime Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>bool IsDaylightSavingTime()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Subtract<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.TimeSpan Subtract(System.DateTime value), System.DateTime Subtract(System&#8230;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToBinary<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>long ToBinary()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToFileTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>long ToFileTime()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToFileTimeUtc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>long ToFileTimeUtc()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToLocalTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime ToLocalTime()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToLongDateString<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string ToLongDateString()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToLongTimeString<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string ToLongTimeString()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToOADate<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>double ToOADate()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToShortDateString<span>&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string ToShortDateString()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToShortTimeString<span>&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string ToShortTimeString()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToString<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>string ToString(), string ToString(string format), string ToString(System.IForma&#8230;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ToUniversalTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Method<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime ToUniversalTime()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">DisplayHint<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>NoteProperty<span>&nbsp;&nbsp; <\/span>Microsoft.PowerShell.Commands.DisplayHintType DisplayHint=DateTime<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Date<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTime Date {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Day<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Day {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">DayOfWeek<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DayOfWeek DayOfWeek {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">DayOfYear<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 DayOfYear {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Hour<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Hour {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Kind<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.DateTimeKind Kind {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Millisecond<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Millisecond {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Minute<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Minute {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Month<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Month {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Second<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Second {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Ticks<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int64 Ticks {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">TimeOfDay<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.TimeSpan TimeOfDay {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Year<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Property<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>System.Int32 Year {get;}<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">DateTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ScriptProperty System.Object DateTime {get=if ((&amp; { Set-StrictMode -Version 1; $this.DisplayHin&#8230;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p><span style=\"line-height: normal;list-style-type: disc\"><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; <\/span><\/span><\/span><\/p><\/blockquote>\n<p>&ldquo;Major bummer,&rdquo; I thought. Now I figure it is going to be pain to retrieve the information. I open up MSDN in my Internet Explorer 9 browser, and begin searching. It does indeed look like it will be a pain. I have to <a target=\"_blank\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.globalization.calendar.getweekofyear.aspx\">create calendar rules, calendar types, and all kinds of culture specific things<\/a> (such as when the first day of the week appears, and how to determine the first week of the year). Ugh, I hate messing around with all that stuff. <i>Whine whine whine whine whine<\/i> (as the Scripting Wife would say). <\/p>\n<p>But I am positive that I have seen a week of the year before, and it did not involve a lot of messy .NET Framework programming. I decided to look up the <a target=\"_blank\" href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd347647.aspx\">help on Get-Date<\/a> to be on the safe side before I started all that work. In the <b>&ndash;uformat<\/b> section I found my answer&hellip;I can use the <b>%V<\/b><i> <\/i>value for the <i>UFormat<\/i> parameter. This is shown here where the command tells me that I am in the 23<sup>rd<\/sup> week as I write this Hey! Scripting Guy blog.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; get-date -UFormat %V<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">23<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt;<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>I decided to write a quick function to return a custom <b>DateTime<\/b> object. At first, I was only going to return the week of the year, but hey, I might want to know what that week of the year is associated with, and so I incorporated a call to the <b>Add-Member<\/b> Windows PowerShell cmdlet. The complete <b>Get-ExtendedDate<\/b> function is shown here. <\/p>\n<p><b>Get-ExtendedDate Function<\/b><\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">function Get-ExtendedDate<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">{<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;<\/span><\/span><span>$a = get-date<\/span><\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp; <\/span><\/span><span>add-member -MemberType scriptmethod -name GetWeekOfYear `<\/span><\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span>-value {get-date -uformat %V} -inputobject $a <\/span><\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;<\/span><\/span><span>$a<\/span><\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;<\/span><\/span><span>} #end function Get-ExtendedDate<\/span><\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>In the <b>Get-ExtendedDate<\/b> function, I first obtain a copy of the <b>System.DateTime<\/b> object by calling the <b>Get-Date<\/b> cmdlet. I store the returned object in the <b>$a<\/b> variable. This is shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">$a = get-date<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>The object stored in the <b>$a<\/b> variable is the base object upon which I will add an additional member. There are several different types of members to add to an object&mdash;I am adding a <b>ScriptMethod<\/b> member because I want to perform a calculation when the member is called. To use the <b>Add-Member<\/b> Windows PowerShell cmdlet, I specify the type of member to add, a name for the member, how the member value is obtained, and an object upon which to add the member. The command is shown here. <\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">add-member -MemberType scriptmethod -name GetWeekOfYear `<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span style=\"color: #000000\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><span>-value {get-date -uformat %V} -inputobject $a<\/span><\/span><\/span><span style=\"font-family: Segoe\"><span> <\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>The last thing I need to do is to return the modified object that is stored in the <b>$a<\/b> variable, and close my curly brackets as shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">$a<\/span><\/span><\/span><\/p>\n<p><span style=\"line-height: normal;list-style-type: disc\"><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;<\/span><\/span><span>} #end function Get-ExtendedDate<\/span><\/span><\/span><\/span><\/p><\/blockquote>\n<p>When I call the <b>Get-ExtendedDate<\/b> function, a standard <b>DateTime<\/b> object is returned. Because it is a standard <b>DateTime<\/b>, the display specifier returns the standard display. This is shown in the following image.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6545.HSG-7-8-11-02_71A8E719.png\"><img decoding=\"async\" height=\"539\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6457.HSG-7-8-11-02_thumb_3172CD9F.png\" alt=\"Image of command output\" border=\"0\" title=\"Image of command output\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" \/><\/a><\/p>\n<p>If I pipe the results of the function to the <b>Get-Member<\/b> cmdlet, I can tell that the additional member is added to the <b>DateTime<\/b> object. The command to do this is shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Get-ExtendedDate | get-member<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>The command and its associated output are shown in the following image.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2251.HSG-7-8-11-03_233454AF.png\"><img decoding=\"async\" height=\"539\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2744.HSG-7-8-11-03_thumb_77EFBDA7.png\" alt=\"Image of command output\" border=\"0\" title=\"Image of command output\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" \/><\/a><\/p>\n<p>To access the new <b>ScriptMethod<\/b>, I have a number of options. The one I have a tendency to use is to call the method directly from the function by using a dotted notation. It sounds more complicated than it is. I use a pair of parentheses to surround the function and then call the method. The only hard part is to remember that I created a method, and therefore an empty pair of parentheses is required at the end of the method name. This is shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; (Get-ExtendedDate).getWeekOfYear()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">23<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>Of course, one can always store the resulting object into a variable, and call the method that way. This is shown here.<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; $b = Get-ExtendedDate<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\Users\\ed&gt; $b.GetWeekOfYear()<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">23<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>In fact, it is because you can store the object in a variable that I decided to add my <b>ScriptMethod<\/b> to the <b>DateTime<\/b> object in the first place. I can use any of the properties and methods of a <i>normal<\/i> <b>DateTime<\/b> object in addition to calling my custom <b>ScriptMethod<\/b>. For example, I might want to do something like the following:<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8220;Today is $($b.ToShortDateString())&#8221;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8220;There are $(365 &#8211; $($b.DayOfYear)) days left in the year.&#8221;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8220;This means there are $(52 &#8211; $($b.GetWeekOfYear())) weeks left in the year.&#8221;<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>In short, I have complete access to the <b>DateTime<\/b> object, and I have access to my new <b>ScriptMethod <\/b>as well. Dude, that makes for a cool solution. By the way, here are the previous commands and their associated output.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8105.HSG-7-8-11-04_3BC3F1FF.png\"><img decoding=\"async\" height=\"506\" width=\"604\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7522.HSG-7-8-11-04_thumb_107F5AF8.png\" alt=\"Image of command output\" border=\"0\" title=\"Image of command output\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" \/><\/a><\/p>\n<p>Well, that is all there is to extending the <b>DateTime<\/b> object to include the <strong>GetWeekOfYear<\/strong> <b>ScriptMethod<\/b>. Join me tomorrow for more Windows PowerShell goodness. <\/p>\n<p>I invite you to follow me on <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> and <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, or post your questions on the <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingforum\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to use Windows PowerShell to easily get the number of the week of the year. Microsoft Scripting Guy, Ed Wilson, is here. It seems that at times things appear to be too hard. At other times, things that I figure might be too hard, end up being super simple. I guess this [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[13,3,4,45],"class_list":["post-13381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-dates-and-times","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to use Windows PowerShell to easily get the number of the week of the year. Microsoft Scripting Guy, Ed Wilson, is here. It seems that at times things appear to be too hard. At other times, things that I figure might be too hard, end up being super simple. I guess this [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=13381"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13381\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=13381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=13381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=13381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}