This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$in = '1212' | |
# Just regex out the characters which are the same as the following character, with a backreference | |
# convert to int, and sum them. Handle the wraparound condition by adding the first character | |
# to the end of the string | |
function day1 { | |
param($s) | |
$s = $s + $s[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-CimInstance -ClassName SoftwareLicensingProduct | | |
Where-Object {$_.ApplicationId -eq "55c92734-d682-4d71-983e-d6ec3f16059f" -and $_.PartialProductKey } | | |
Select-Object Name, | |
@{Name="LicenseStatus"; Expression = { | |
switch ($_.LicenseStatus) { 0 { "Unactivated"} | |
1 { "Activated" } | |
default { "unknown" } | |
} } } |
NewerOlder