Search found 190 matches

by Simon Sheppard
2023-Oct-30, 7:39 pm
Forum: Windows PowerShell
Topic: PowerShell function to return Bank Holidays
Replies: 3
Views: 4476

Re: PowerShell function to return Bank Holidays

German bank holidays function Get-GermanHoliday { param ( [int] $Year = (Get-Date).Year, [ValidateSet("BB","BE","BW","BY","HB","HE","HH","MV","NATIONAL", "NI","NW","RP","SH&q...
by Simon Sheppard
2023-Oct-30, 7:38 pm
Forum: Windows PowerShell
Topic: PowerShell function to return Bank Holidays
Replies: 3
Views: 4476

Re: PowerShell function to return Bank Holidays

French Bank holidays function Get-FrenchHoliday { param ( [int] $Year = (Get-Date).Year, [ValidateSet("alsace-moselle", "guadeloupe", "guyane", "la-reunion", "martinique", "mayotte", "metropole", "nouvelle-caledonie", &...
by Simon Sheppard
2023-Oct-30, 7:37 pm
Forum: Windows PowerShell
Topic: PowerShell function to return Bank Holidays
Replies: 3
Views: 4476

PowerShell function to return Bank Holidays

A PowerShell function to return UK Bank Holidays. function Get-BankHolidaysUK { param ( [int] $Year = (Get-Date).Year, [ValidateSet("england-and-wales", "scotland", "northern-ireland")] [string] $country = 'scotland' ) $url = 'https://www.gov.uk/bank-holidays.json/' $ba...
by Simon Sheppard
2023-Oct-27, 5:27 pm
Forum: Linux & macOS Bash
Topic: Forgotten BASH built-in
Replies: 3
Views: 11948

Re: Forgotten BASH built-in

A lot of linux distros e.g. Ubuntu don't include that in bash, but macOS does so I guess I should include it there.
by Simon Sheppard
2023-Oct-20, 7:20 pm
Forum: Windows CMD Shell
Topic: What's the best way to move directories and files?
Replies: 1
Views: 4174

Re: What's the best way to move directories and files?

jason404 wrote: 2023-Oct-20, 12:31 pm Should I use robocopy
Yes Robocopy is made for this kind of task.
by Simon Sheppard
2023-Oct-05, 10:04 pm
Forum: Windows CMD Shell
Topic: Errorlevel oddities
Replies: 2
Views: 4364

Re: Errorlevel oddities

I think you are being bitten by delayed expansion Change the start to something like this to get the main part outside of the brackets :: Check if the MyService service exists where sc >nul 2>nul if %errorlevel% neq 0 goto SC_MISSING sc query MyService | find "STATE" >nul echo Errorlevel i...
by Simon Sheppard
2023-Oct-05, 6:34 pm
Forum: Windows CMD Shell
Topic: Output of %TIME% and Time/ T is region dependent
Replies: 2
Views: 10191

Re: Output of %TIME% and Time/ T is region dependent

I don't remember the exact time settings which gave 13 O' clock, but probably something like Hm:Hm
by Simon Sheppard
2023-Aug-31, 6:41 pm
Forum: Windows PowerShell
Topic: Closing a PowerShell window with other keys [SOLVED]
Replies: 2
Views: 10352

Re: Closing a PowerShell window with other keys

You could probably modify this function (function Test-KeyPress) to get that behaviour:

https://powershell.one/tricks/input-dev ... -key-press
by Simon Sheppard
2023-Aug-26, 9:30 pm
Forum: Windows PowerShell
Topic: Get-DnsClientCache converts/displays an integer for RecordType
Replies: 1
Views: 10088

Re: Get-DnsClientCache converts/displays an integer for RecordType

Getting sensible values out of this was harder than I expected, they are both hard coded and in [uint16] so you will need something like this: # Hash table of Types $dnstypes = @{ [uint16]1 = "A" [uint16]2 = "NS" [uint16]5 = "CNAME" [uint16]6 = "SOA" [uint16]1...