Search found 178 matches
- 2023-Oct-30, 7:39 pm
- Forum: Windows PowerShell
- Topic: PowerShell function to return Bank Holidays
- Replies: 3
- Views: 4726
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...
- 2023-Oct-30, 7:38 pm
- Forum: Windows PowerShell
- Topic: PowerShell function to return Bank Holidays
- Replies: 3
- Views: 4726
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: 4726
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: 12518
- 2023-Oct-27, 5:27 pm
- Forum: Linux & macOS Bash
- Topic: Forgotten BASH built-in
- Replies: 3
- Views: 12518
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: 4264
- 2023-Oct-05, 10:04 pm
- Forum: Windows CMD Shell
- Topic: Errorlevel oddities
- Replies: 2
- Views: 4440
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: 10262
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: 10587
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: 10311
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...