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
$vm = Get-AzVM -Status | % { Add-Member -InputObject $_ -Name "NICObj" -MemberType NoteProperty -Value (Get-AzNetworkInterface -ResourceId $_.NetworkProfile.NetworkInterfaces[0].id) -Force -PassThru } | | |
% { Add-Member -InputObject $_ -Name "PrivateIP" -MemberType NoteProperty -Value ($_.NICObj.IpConfigurations[0].PrivateIpAddress) -Force -PassThru} | | |
% { if ($_.NICObj.IpConfigurations[0].PublicIpAddress.count -gt 0) { | |
$rIdparsed = $_.NICObj.IpConfigurations[0].PublicIpAddress[0].Id -split "/"; | |
Add-Member -InputObject $_ -Name "PublicIP" -MemberType NoteProperty -Value ((Get-AzPublicIpAddress -Name $rIdparsed[-1] -ResourceGroupName $rIdparsed[4]).IpAddress) -Force -PassThru | |
} | |
else { | |
$_ | |
} | |
} | |
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
$q = "resources | |
| where type == `"microsoft.insights/metricalerts`" | |
| extend prop = parse_json(properties) | |
| extend agId = tolower(tostring(prop.actions[0].actionGroupId)) | |
| project metricsid = ['id'], mname = name, mresourceGroup = resourceGroup, agId | |
| join kind = inner ( resources | |
| where type == `"microsoft.insights/actiongroups`" | |
| extend prop = parse_json(properties) | |
| project actiongroupid = tolower(id), aname = name, aresourcegroup = resourceGroup, whURL = tostring(prop.webhookReceivers[0].serviceUri) | |
| where whURL != `"`") |
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
include "all_equal.mzn"; | |
% config section | |
int: maxClusterSize = 6; | |
float: minNodeRAMConsumption = 0.5; | |
float: maxNodeRAMConsumption = 0.8; | |
float: minNodeCPUConsumption = 0.1; | |
float: maxNodeCPUConsumption = 0.8; | |
% end config |
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
$ids = Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | ? {$_.id -eq 3} | |
$commObjects = $ids | % { | |
New-Object psobject -Property @{ | |
RuleName = $_.Properties[0].value | |
UtcTime = $_.Properties[1].value | |
ProcessGuid = $_.Properties[2].value | |
ProcessId = $_.Properties[3].value | |
Image = $_.Properties[4].value | |
User = $_.Properties[5].value | |
Protocol = $_.Properties[6].value |
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 Get-PodStatus { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$ContextName, | |
[Parameter(Mandatory = $false)] | |
[switch]$All | |
) | |
end { |
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
$passwords = "<pwd1>", | |
"<pwd2>", | |
"<pwd3>" | |
$keys = $passwords | % { | |
$sDate = Get-Date | |
$eDate = $sDate.AddYears(10) | |
$kID = (New-Guid).Guid | |
$value = $_ | |
$keydata = [Microsoft.Azure.Graph.RBAC.Version1_6.Models.PasswordCredential]::new($sDate, $eDate, $kID, $value) |
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
{ | |
"apiVersion": "vlabs", | |
"properties": { | |
"orchestratorProfile": { | |
"orchestratorType": "Kubernetes", | |
"kubernetesConfig": { | |
"privateCluster": { | |
"enabled": true | |
}, | |
"kubeletConfig": { |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"clusterName": { | |
"type": "string" | |
}, | |
"kubernetesVersion": { | |
"type": "string", | |
"defaultValue": "1.10.6", |
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
$rgName = "kubetest" | |
$vms = Get-AzureRmVM -ResourceGroupName $rgName | |
$nics = Get-AzureRmNetworkInterface -ResourceGroupName $rgName | |
$pubIPs = Get-AzureRmPublicIpAddress -ResourceGroupName $rgName | |
$vmNics = @{} | |
$nics | ForEach-Object { | |
$index = $_.id | |
$value = $_ | |
$vmNics[$index] += @($value) |
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 Test-Password { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline=$true)] | |
[string]$Password | |
) | |
begin { | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
} |
NewerOlder