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
# ChatGPT was asked to create a script: | |
# "Write a powershell script to install AD and create users, groups, OUs and GPOs" | |
# | |
# This is what it came up with! | |
"Write a powershell script to install AD and create users, groups, OUs and GPOs" | |
this is what it came up with! |
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
# Measure-HowLongRishi.ps1 | |
# A script to predecit when Rishi will be gone | |
# He started on Oct 25 2022 | |
$StartDate = 'October 25 2022 10:30' | |
$Start = Get-Date $StartDate -DisplayHint Date | |
"It all started on [$($Start.datetime)]" | |
# When will it end? | |
$TheEnd = $Start.AddMonths(18) # He will be cone in 18 months |
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
# This Gist is the code for the VM quick create article at: | |
# https://docs.microsoft.com/azure/virtual-machines/windows/quick-create-portal | |
# DoctorDNS@Gmail.Com | |
# Connect to Azure | |
Connect-AzAccount | |
# Create a new resource group | |
New-AzResourceGroup -Name MyResourceGroup -Location 'UKSouth' |
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
# Gist for Secrets Management PS Community Blog Post | |
# 1. Discover the modules | |
Find-Module -Name 'Microsoft.PowerShell.Secret*' | | |
Format-Table -Wrap -AutoSize | |
# 2. Install both modules | |
Install-Module -Name $Names -Force -AllowClobber | |
# 3. Examine them |
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
+# Setup-VSCodeEvironment.ps1 | |
# (c) 2020 Thomas Lee (DoctorDNS@Gmail.Com) | |
# This Gist adds the Concordia Code font to Windows and configures VS Code | |
# This script is part of Thomas Lee's PowerShell 7 book published by Wiley | |
# If you are are seeking to reproduce the environment for PowerShell 7 to follow the book's contents, | |
# Run this script in VS Code, using PowerShell 7. Run this after you install each VM and after you have installed PowerShell 7. | |
# NB: This Gist uses PowerShell 7 features so you must run it either in VS COde or theConsole after |
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
# Sample PowerShell 7 Profile File | |
# Copy the contents of this GIST to $Profile | |
# Meant to be a starting point. | |
# Greet the usser | |
"In Customiaations for: [$($Host.Name)]" | |
"For : [$(whomi)]" | |
"On ; [$(hostname)]" | |
# Set Me |
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
# Set-PowerShell7Environment.ps1 | |
# This Gist installs PowerShell 7 and VS Code | |
# Run this in Windows PowerShell 5.1 to bootstrap your way to Powerhell 7. | |
# This script is part of Thomas Lee's PowerShell 7 book published by Wiley | |
# If you are are seeking to reproduce the environment for PowerShell 7 to follow the book's contents, | |
# Run this script after you install each VM and before you start using the VM. | |
# 1. Set execution polity and install Nuget and PowerShellGet - Just in case | |
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force |