# load module that defines the function: PS C:\> New-TemporaryFile-WhatIf What if: Performing the operation "New-TemporaryFile" on target "C:\Users\tobia\AppData\Local\Temp".
# dump function source code: PS C:\> ${function:New-TemporaryFile}
PS> [System.Globalization.CultureInfo]::GetCultureInfo( 'ru' ).DateTimeFormat.MonthNames Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь
[PSCustomObject]@{ Id = $x+1 English = $english[$x] Russian = $russian[$x] } }
结果类似这样:
Id English Russian
-- ------- -------
1 January Январь
2 February Февраль
3 March Март
4 April Апрель
5 May Май
6 June Июнь
7 July Июль
8 August Август
9 September Сентябрь
10 October Октябрь
11 November Ноябрь
12 December Декабрь
Name DisplayName --------------- aa Afar aa-DJ Afar (Djibouti) aa-ER Afar (Eritrea) aa-ET Afar (Ethiopia) af Afrikaans af-NA Afrikaans (Namibia) af-ZA Afrikaans (South Africa) ...
$startdate = [DateTime]'2022-06-01' $numberOfWeeks = 52 $result = for ($week = 0; $week-lt$numberOfWeeks; $week ++) { # calculate the real date each week $realdate = $startdate + (New-Timespan-days (7*$week))
# calculate the current month $month = $realdate.Month
# calculate the days in this month $daysInMonth = [DateTime]::DaysInMonth($realdate.Year, $realdate.Month)
# make arbitrary adjustments, i.e. set start time to 12PM by default, but 7PM on the last week of a month
# are we in the last week of a month? if ($realdate.Day -gt ($daysInMonth-7)) { # add 19 hours $realdate = $realdate.AddHours(19) } else { # add 12 hours $realdate = $realdate.AddHours(12) }
# create your Excel sheet layout as a CSV file [PSCustomObject]@{ Start = $realdate IsOnline = $false Title = '' Speaker = '' Notes = '' } }