I hereby claim:
- I am windos on github.
- I am windosnz (https://keybase.io/windosnz) on keybase.
- I have a public key ASAfWmAOfO_MviM60G-tNVJBpgl43PTNPJlsiFzi2IyYtQo
To claim this, I am signing this object:
| $env:difftool = 'C:\ProgramData\chocolatey\bin\meld.exe' | |
| if ($env:TERM_PROGRAM -eq 'VSCode' -or $env:WT_SESSION) { | |
| if ($psedition -eq 'core') { | |
| $ansiesc = "`e" | |
| } else { | |
| $ansiesc = [char]0x1b | |
| } | |
| Set-PSReadlineOption -Colors @{ |
| # Icons care of Wikimedia Commons | |
| # https://commons.wikimedia.org/wiki/File:Circle-icons-chat.svg | |
| # https://commons.wikimedia.org/wiki/File:Pictogram_reply_soft_green_wbg.svg | |
| $ChatIcon = 'C:\Demos\Circle-icons-chat.svg.png' | |
| $ReplyIcon = 'C:\Demos\Pictogram_reply_soft_green_wbg.svg.png' | |
| # Download from here: https://www.nuget.org/packages/Microsoft.Toolkit.Uwp.Notifications/ |
I hereby claim:
To claim this, I am signing this object:
| Add-Type -Path 'C:\temp\microsoft.toolkit.uwp.notifications.7.0.0\lib\net461\Microsoft.Toolkit.Uwp.Notifications.dll' | |
| $CompatMgr = [Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat] | |
| Register-ObjectEvent -InputObject $CompatMgr -EventName OnActivated -Action { | |
| if ($Event.SourceArgs.Argument -eq 'SubmitButton') { | |
| switch ($Event.SourceArgs.UserInput.Value) { | |
| Item1 { | |
| $Text1 = 'GIF: Picard Facepalm' | |
| $ImagePath = 'C:\Demos\Gifs\facepalm.gif' | |
| } |
| # See challenge prompt here: https://jdhitsolutions.com/blog/powershell/8107/scripting-challenge-meetup/ | |
| $HelpAbout = help about_Splatting | |
| $Words = $HelpAbout -replace '_', ' ' -split '\b' | Where-Object {$_ -match '\w+' -and $_ -ne 'the'} | |
| $GroupedWords = $Words | Group-Object | Sort-Object -Property Count -Descending | |
| [PSCustomObject] @{ | |
| Name = $HelpAbout.Name | |
| WordCount = $Words.Count |
| # May need to update the "Chrome Driver", run this from the module path (it's not an imported command) | |
| # .\Selenium-Binary-Updater.ps1 | |
| # Start the driver (this is headless so you shouldn't see anything. Do this once. | |
| $StartUri = 'https://www.twitch.tv/' | |
| $Driver = Start-SeChrome -Arguments "incognito" -HideVersionHint -StartURL $StartUri -Quiet -Headless | |
| # Repeat this part for each profile | |
| # Specify the user you're looking for | |
| $UserName = 'WindosNZ' |
| # Install-Module BurntToast | |
| $Text1 = New-BTText -Content 'Help!' | |
| $Text2 = New-BTText -Content "Please send help." | |
| $Audio1 = New-BTAudio -Source 'ms-winsoundevent:Notification.Mail' | |
| # Point the source at a gif that exists... | |
| $HeroImage = New-BTImage -Source 'C:\Temp\Help.gif' -HeroImage | |
| $Binding1 = New-BTBinding -Children $Text1, $Text2 -AppLogoOverride $Image1 -HeroImage $HeroImage |
| # Needs the SharePoint Online PnP module, install if haven't got it already: | |
| # Install-Module SharePointPnPPowerShellOnline | |
| $Uri = 'https://tenant.sharepoint.com/sites/Common' | |
| Connect-PnPOnline -Url $Uri -UseWebLogin | |
| $DeletedAt = (Get-Date -Day 24 -Month 05 -Hour 0 -Minute 0 -Second 0) | |
| $DeletedBy = '[email protected]' |
| $XmlString = @" | |
| <toast> | |
| <visual> | |
| <binding template="ToastGeneric"> | |
| <text>Default Notification</text> | |
| <image src="C:\Program Files\PowerShell\7\assets\Powershell_av_colors.ico" placement="appLogoOverride" /> | |
| </binding> | |
| </visual> | |
| <audio src="ms-winsoundevent:Notification.Default" /> | |
| </toast> |
| break | |
| #region Null Coalescing Operator (??) | |
| # Returns value on the left if it's not null | |
| # Otherwise the right had side is evaluated and returned | |
| $Left ?? $Right | |