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
| # Source: https://stackoverflow.com/a/43317244 | |
| $path = ".\aws-ec2-key.pem" | |
| # Reset to remove explict permissions | |
| icacls.exe $path /reset | |
| # Give current user explicit read-permission | |
| icacls.exe $path /GRANT:R "$($env:USERNAME):(R)" | |
| # Disable inheritance and remove inherited permissions | |
| icacls.exe $path /inheritance:r | |
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 steps that build, run tests, deploy, and more: | |
| # https://aka.ms/yaml | |
| name: Sandy_Build_$(date:yyyyMMdd)$(rev:.r) | |
| trigger: | |
| - none | |
| pool: | |
| #name: 'Self-Hosted VS2017' (Self-hosted build agent) | |
| vmImage: 'ubuntu-latest' # (use this for the Microsoft-hosted build agent) |
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 steps that build, run tests, deploy, and more: | |
| # https://aka.ms/yaml | |
| name: Hubble_Build_$(date:yyyyMMdd)$(rev:.r) | |
| trigger: | |
| - none | |
| pool: | |
| #name: 'Self-Hosted VS2017' (Self-hosted build agent) | |
| vmImage: 'ubuntu-latest' # (use this for the Microsoft-hosted build agent) |
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
| # Christopher Jackson (@azurejackson; @ethicaljeans) | |
| # May, 2020 | |
| # | |
| # This code accesses a Key Vault certificate and certificate password and creates a new | |
| # exported certificate based a certificate password which is also stored in Key Vault | |
| # | |
| # export-certificate-with-password.ps1 | |
| Connect-AzAccount | |
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
| # Christopher Jackson | |
| # Generate a range of Bitcoin Transaction fees based on speed | |
| # 1/7/2018 | |
| $satoshi = 0.00000001 | |
| $size = 226 | |
| $btcprice = 16750 | |
| $json = $(Invoke-WebRequest -Uri https://bitcoinfees.earn.com/api/v1/fees/list -UseBasicParsing).Content | ConvertFrom-Json | |
| $fees = $json.fees |
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
| # Author: Christopher Jackson <[email protected]> | |
| # 4/5/2017 | |
| # New-EncryptedVM.ps1 | |
| # | |
| # This PowerShell script creates a new Resource Group where it deploys a new Windows VM, a Keyvault with an AD App and KeyEncryptionKey which is uses to encrypt the VM | |
| # Please login to your Azure Environment before running this script. This script create all new resources | |
| # For more info: https://docs.microsoft.com/en-us/azure/security/azure-security-disk-encryption | |
| $ResourceGroupName = "EncryptRG" | |
| $VMName = "EncryptWin1" |
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
| # Christopher Jackson | |
| # March 1, 2017 | |
| Get-PhysicalDisk | Where-Object CanPool -eq $true | |
| $PhysicalDisk = Get-PhysicalDisk | Where-Object CanPool -eq $true | |
| New-StoragePool -FriendlyName "StoragePool1" -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $PhysicalDisk | |
| $virtualDisk = New-VirtualDisk -StoragePoolFriendlyName "StoragePool1" -UseMaximumSize -ProvisioningType Fixed -ResiliencySettingName "Simple" -FriendlyName "DataDisk" | |
| $virtualDisk | Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -Force -Confirm:$false |
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
| # Christopher Jackson | |
| # Feb 23, 2017 | |
| # List all NICs that are not attached to a VM | |
| Get-AzureRmNetworkInterface | where { !$_.VirtualMachine } | Select Name,ResourceGroupName,Primary | |
| # Remove all NICs that are not attached to a VM | |
| Get-AzureRmNetworkInterface | where { -Not $_.VirtualMachine } | Remove-AzureRmNetworkInterface | |
| # Get a list of all Azure PublicIP addresses and the NIC they are associated with. |
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
| # Christopher Jackson | |
| # 3/10/2017 | |
| # This script gives you storage accounts that are not used by a Virtual Machine's OS disk, hinting that perhaps you may want to delete the storage upon closer inspection. | |
| # One could possibly pipe the output to Remove-AzureRmStorageAccount for deletion. | |
| # Warning: Some accounts are diagnostic accounts which could be used by a VM. Also this scripts currently only looks at OS disk storage accounts and not Data disk, | |
| # since it is more likely that data disks reside in the same storage account as OS disks. | |
| Function Get-AllVmStorageAccount | |
| { |