elements = []
for x in range(10000):
elements.append(x)
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
# Copyright: (c) 2023, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
Function Get-SqlServerTlsCertificate { | |
<# | |
.SYNOPSIS | |
Gets the MS SQL X509 Certificate. | |
.DESCRIPTION | |
Gets the X509 Certificate that is being used by a remote MS SQL Server. |
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
# Copyright: (c) 2022, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
Function Trace-TlsHandshake { | |
<# | |
.SYNOPSIS | |
TLS Handshake Diagnostics. | |
.DESCRIPTION | |
Performs a TLS handshake and returns diagnostic information about that |
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 findshit ($str) { | |
$str = [regex]::escape($str) | |
Select-String -Pattern $str -Path (Get-ChildItem C:\github\dbatools\*.ps* -Recurse -Exclude 'allcommands.ps1', '*.dll', "*psproj") | |
} |
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
######## POSH-GIT | |
# with props to https://bradwilson.io/blog/prompt/powershell | |
# | |
# | |
# Now for this to work most beautifully - you will need to have the latest posh-git module | |
# | |
# You will also need the MesloLGM Nerd Font Mono font | |
# from here https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Meslo/M/Regular/complete/Meslo%20LG%20M%20Regular%20Nerd%20Font%20Complete.ttf | |
# if you are super nerdy | |
# or |
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 -Version 7 | |
# Version 1.2.13 | |
# check if newer version | |
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e" | |
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version') | |
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)" | |
if ([System.IO.File]::Exists($latestVersionFile)) { |
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
<# | |
Listing of the required information to install SQL Server Management Studio via the Package resource with PowerShell DSC. | |
# Example config: | |
Configuration InstallSSMS { | |
Package InstallSsms { | |
Ensure = "Present" | |
ProductID = <GUID value> | |
Name = Full SSMS Name that displays in Program Features | |
Path = SSMS-Setup-ENU.exe |
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
# Get credentials and store them securely in an encrypted xml file | |
if (-NOT (Test-Path "${env:\userprofile}\DBA001.Cred")){ | |
$Credential = Get-Credential | |
$Credential | Export-CliXml -Path "${env:\userprofile}\DBA001.Cred" | |
} | |
#Load the credentials | |
$SqlCredential = Import-CliXml -Path "${env:\userprofile}\DBA001.Cred" | |
# Create a CSV of all the databases that are in the availability group. This updates each time to be complete |
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
{ | |
"Write Verbose": { | |
"prefix": "wv", | |
"body": [ | |
"Write-Verbose \"[${TM_FILENAME/(.*)\\..+$/$1/}] $0\"" | |
], | |
"description": "Write-Verbose with base name of filename." | |
}, | |
NewerOlder