This file contains 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
from diagrams import Cluster, Diagram, Edge | |
from diagrams.azure.general import Usericon, Resourcegroups | |
from diagrams.azure.compute import ContainerInstances | |
from diagrams.azure.integration import APIManagement | |
from diagrams.azure.devops import Devops, Pipelines, Repos | |
graph_attrs = { | |
'bgcolor': 'snow2', | |
'fontsize': '48', | |
'labelloc': 'top', |
This file contains 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
#!/usr/bin/env bash | |
# pilfered from a MSFT AKS tutorial and tweaked | |
if [ "$#" -ne 2 ]; then | |
echo "Will export env variables that end with <search_string>" | |
echo "Usage: $0 <search_string> <output_filename>" | |
exit 1 | |
fi |
This file contains 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
$pathKey = 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' | |
$tfFilename = 'terraform_1.1.5_windows_amd64.zip' | |
$tfURL = "https://releases.hashicorp.com/terraform/1.1.5/$tfFilename" | |
$tfPath = 'C:\tf' | |
Invoke-WebRequest $tfURL -UseBasicParsing -OutFile $tfFilename | |
Expand-Archive ".\$tfFilename" -DestinationPath $tfPath -Force | |
$oldpath = (Get-ItemProperty -Path $pathKey -Name PATH).path |
This file contains 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
$blah = get-childitem -Path c:\temp -Directory | |
$AddedTicks = Measure-Command -Expression { | |
$AddedToArray = @() | |
foreach ($b in $blah) { | |
$myOBJ = New-Object System.Object | |
$myOBJ | Add-Member -Type NoteProperty -Name IsBlah -Value $b.BaseName | |
$AddedToArray += $myOBJ | |
} | |
} | Select-Object Ticks |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<bpr:release xmlns:bpr="http://www.blueprism.co.uk/product/release"> | |
<bpr:name>BPRelease v3</bpr:name> | |
<bpr:release-notes> | |
</bpr:release-notes> | |
<bpr:created>2018-03-31 04:20:16Z</bpr:created> | |
<bpr:package-id>4</bpr:package-id> | |
<bpr:package-name>BPRelease_Info Troubleshooting</bpr:package-name> | |
<bpr:user-created-by>admin</bpr:user-created-by> | |
<bpr:contents count="2"> |
This file contains 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 Invoke-PiHoleApi { | |
[CmdletBinding( | |
SupportsShouldProcess = $true, | |
ConfirmImpact = "High" | |
)] | |
param( | |
[ValidateSet('type', 'version', 'summaryRaw', 'summary', 'overTimeData10mins', 'recentBlocked', 'topItems', 'getQuerySources', 'getForwardDestinations', 'getQueryTypes', 'getAllQueries', 'enable', 'disable')] | |
[String]$Method = 'summary', | |
[String]$Token = 'a67cc2dccc636ec92842101cc4de47a8c8132e6688415b8a2d7230c2142db2a6', | |
[String]$Address = '192.168.1.18' |
This file contains 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
$NetBiosName = "DOMAIN" | |
(Get-Acl c:\temp).Access | | |
Where-Object { | |
($_.IdentityReference -split '\\') -eq $NetBiosName | |
} | | |
ForEach-Object { | |
$SAMAccountName = ($_.IdentityReference -split '\\')[1] | |
$Class =( Get-ADObject -Filter {Samaccountname -eq $SAMAccountName}).objectclass | |
switch ($Class) { |
This file contains 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 Give-UserLicense ($User) { | |
#return $true | |
} | |
Function Add-UserLicenses { | |
param( | |
[Parameter( | |
Mandatory = $true, | |
ValueFromPipelineByPropertyName = $true, | |
ValueFromPipeline = $true | |
)][String[]]$Username |
This file contains 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 getSpace { | |
[cmdletbinding()] | |
param( | |
[string]$space = ' ', | |
[string]$separator = '-', | |
[int]$depth | |
) | |
Write-Output $(($space + $separator) * $depth) | |
} |
This file contains 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
[cmdletbinding()] | |
param( | |
# Give the user the opton to user a -User command line parameter | |
[string]$User = $(Read-Host "Enter a samAccountName") | |
) | |
# Show $User details on console | |
# Consider which properties you actually need | |
# Using * is a memory hog and unnecesary | |
try { |
NewerOlder