Search found 177 matches
- 2023-Oct-30, 7:38 pm
- Forum: Windows PowerShell
- Topic: PowerShell function to return Bank Holidays
- Replies: 3
- Views: 4539
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", &...
- 2023-Oct-30, 7:37 pm
- Forum: Windows PowerShell
- Topic: PowerShell function to return Bank Holidays
- Replies: 3
- Views: 4539
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...
- 2023-Oct-30, 7:33 pm
- Forum: Linux & macOS Bash
- Topic: Forgotten BASH built-in
- Replies: 3
- Views: 12196
- 2023-Oct-27, 5:27 pm
- Forum: Linux & macOS Bash
- Topic: Forgotten BASH built-in
- Replies: 3
- Views: 12196
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.
- 2023-Oct-20, 7:20 pm
- Forum: Windows CMD Shell
- Topic: What's the best way to move directories and files?
- Replies: 1
- Views: 4222
- 2023-Oct-05, 10:04 pm
- Forum: Windows CMD Shell
- Topic: Errorlevel oddities
- Replies: 2
- Views: 4400
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...
- 2023-Oct-05, 6:34 pm
- Forum: Windows CMD Shell
- Topic: Output of %TIME% and Time/ T is region dependent
- Replies: 2
- Views: 10218
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
- 2023-Aug-31, 6:41 pm
- Forum: Windows PowerShell
- Topic: Closing a PowerShell window with other keys [SOLVED]
- Replies: 2
- Views: 10415
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
https://powershell.one/tricks/input-dev ... -key-press
- 2023-Aug-26, 9:30 pm
- Forum: Windows PowerShell
- Topic: Get-DnsClientCache converts/displays an integer for RecordType
- Replies: 1
- Views: 10154
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...
- 2023-Aug-25, 6:55 pm
- Forum: Windows CMD Shell
- Topic: PUSHD example logic inverted
- Replies: 3
- Views: 10018
Re: PUSHD example logic inverted
Thanks all, fixed now