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
| ### Requires openssl (https://www.openssl.org/). | |
| ### Usage: | |
| ### .\extract_rsa_privatekey.ps1 .\YOUR_CERTIFICATE.pfx (ConvertTo-SecureString "YOUR_STRONG_PASSWORD" -AsPlainText -Force) | |
| param( | |
| [Parameter(Mandatory=$true)][string] $certificatePfxPath, | |
| [SecureString] $password, | |
| [string] $pathToOpenSsl = '.' | |
| ) |
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
| <# | |
| .DESCRIPTION | |
| Powershell script to diff two files with SHA256 hash. | |
| .OUTPUTS | |
| System.String. Add-Extension returns a string with the extension or file name. | |
| .EXAMPLE | |
| PS> .\AreSameFile.ps1 .\deployed.json .\expected_different.json | |
| #> |
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
| $bits_in_a_byte = 8 | |
| $base2 = 2 | |
| $base16 = 16 | |
| Function ConvertTo-HexFromByteArray | |
| { | |
| param( | |
| [parameter(Mandatory=$true)] | |
| [Byte[]] | |
| $bytes |
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
| <# | |
| .DESCRIPTION | |
| Powershell script to add permissions to X509 certificate private key for specific user. | |
| .OUTPUTS | |
| Set-Acl result | |
| .EXAMPLE | |
| PS> .\Set-AclForCertificate.ps1 'your_cert_thumbprint' 'domain\username' 'Read' | |
| or | |
| PS> .\Set-AclForCertificate.ps1 'your_cert_thumbprint' 'domain\username' 'FullControl' | |
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
| <# | |
| .DESCRIPTION | |
| Powershell functions to Flatten JSON to the expected Key/Value format used by Azure. | |
| .OUTPUTS | |
| HashTable that contains the flattened json properties and values. | |
| .EXAMPLE USAGE | |
| . /Flatten-Json.ps1 # Source the file to load the functions. | |
| $json = Get-Content '.\appSettings.json' -Raw | ConvertFrom-Json | |
| Flatten-Json $json |
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
| <# | |
| .DESCRIPTION | |
| Powershell script to continuously ping a target host. | |
| If logPath is specified, will output rolling logs based off size parameter. | |
| .OUTPUTS | |
| Set-Acl result | |
| .EXAMPLE | |
| PS> .\PingUntil.ps1 'DateTime_to_Stop' 'your_target_host' 'delayInMs' 'logPath' 'maxFileSizeInMB' | |
| or | |
| PS> .\PingUntil.ps1 (Get-Date).AddSeconds(10) 'www.google.com' 100 'C:\somedir\logs\ping.log' 100 |
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
| import sys, getopt, os, random, string | |
| def generate_random_string(character_space: str, size_in_bytes: int) -> str: | |
| return "".join([random.choice(character_space) for i in range(size_in_bytes)]) | |
| def generate_random_string_file(filepath: str, size_in_bytes: int) -> None: | |
| """ | |
| Generate big random letters/alphabets to a file. |
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
| { | |
| "cSpell.ignoreWords": [ | |
| "assertpy", | |
| "backfilling", | |
| "checkpointed", | |
| "checkpointing", | |
| "dagrr", | |
| "databricks", | |
| "dataframe", | |
| "dataframes", |
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/bash | |
| # Usage | |
| # ./create_azure_devops_release_definition.sh "YOUR_ORG" "YOUR_PROJECT" | |
| Organization=$1 | |
| Project=$2 | |
| azureDevOpsTokenUri="https://vssps.dev.azure.com/$Organization" | |
| azureDevOpsReleaseUri="https://vsrm.dev.azure.com/$Organization" |
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
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| using System; | |
| namespace CommonTests.Attributes | |
| { | |
| /// <summary> | |
| /// Abstract base class for use with TestMethodWithIgnoreIfSupportAttribute.cs. | |
| /// Interfaces don't | |
| /// </summary> |