for cask in $(brew list --cask); do brew upgrade --cask $cask; done;
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
Install-Module -Name Microsoft.PowerShell.SecretManagement | |
Install-Module Az.KeyVault | |
$VaultParameters = @{ | |
AZKVaultName = <Your-Key-Vault-Name> | |
SubscriptionId = <Your-SubscriptionId-Hosting-Your-Key-Vault> | |
} | |
Register-SecretVault -Module Az.KeyVault -Name 'AzKeyVault' -VaultParameters $VaultParameters |
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
function Find-ClosestDate { | |
param( | |
[Parameter(Mandatory)] | |
[DateTime]$GivenDate, | |
[Parameter(Mandatory)] | |
[DateTime[]]$CompareDates | |
) | |
$Result = $CompareDates | Select-Object -Property Date, @{ Name = "Index"; Expression = { [math]::abs($($_.Subtract($GivenDate)).TotalSeconds) } } | |
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
#!/bin/sh | |
# Homebrew Script for OSX | |
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh` | |
echo "Install brew..." | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
echo "Install Rosetta 2..." | |
softwareupdate --install-rosetta |
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
AlertEvidence | |
| mv-apply ParsedFields = parse_json(AdditionalFields) on | |
( | |
extend Key = tostring(bag_keys(ParsedFields)[0]) | |
| project Key, Value = ParsedFields[Key] | |
) | |
| project-away AdditionalFields |
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
function Remove-Properties { | |
<# | |
.SYNOPSIS | |
Remove a list of properties from an object. | |
.DESCRIPTION | |
Loops through a list of given properties and removes them from the object. | |
.PARAMETER Object | |
Object to update. |
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
function Join-Object { | |
<# | |
.SYNOPSIS | |
Join properties of two objects into one. | |
.DESCRIPTION | |
Compare properties from two objects and join them into one. | |
If properties exist in both objects and their values are not equal, reference values will be replaced. | |
Properties which only exist in the difference object will be added to the reference object. |
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
# Add this snippet to your PowerShell profile to detect if PowerShell is running in the integrated terminal of VS Code. | |
# If true, the snippet immports .vscode.ps1 from the root dir or profile.ps1 from your .vscode directory. | |
$ScriptRoot = [System.IO.Directory]::GetCurrentDirectory() | |
if ($env:TERM_PROGRAM -eq 'vscode') { | |
if ([System.IO.File]::Exists("$ScriptRoot/.vscode.ps1")) { | |
Import-Module -Name "$ScriptRoot/.vscode.ps1" | |
return "Successfully loaded workspace profile." | |
} | |
elseif ([System.IO.File]::Exists("$ScriptRoot/.vscode/profile.ps1")) { |