Skip to content

Instantly share code, notes, and snippets.

Avatar

Sarah weeyin83

View GitHub Profile
@weeyin83
weeyin83 / winget-laptoprebuild.ps1
Last active Oct 18, 2021
Install applications using WinGet
View winget-laptoprebuild.ps1
winget install --id git.git -h ; winget install --id Microsoft.VisualStudioCode -h; winget install --id Putty.Putty -h ; winget install --id spotify.spotify -h ; winget install "windows terminal" -h ; winget install --id jabra.direct -h ; winget install --id VideoLAN.VLC -h ; winget install --id Microsoft.PowerToys -h ; winget install --id whatsapp.whatsapp -h ; winget install --id zoom.zoom -h ; winget install --id SlackTechnologies.Slack -h ; winget install --id microsoft.powershell -h ;
@weeyin83
weeyin83 / update.ps1
Last active Oct 13, 2021
Update Windows From PowerShell
View update.ps1
#TLS Setting
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#Trust PowerShell Gallery - this will avoid you getting any prompts that it's untrusted
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
#Install NuGet
Install-PackageProvider -name NuGet -Force
#Install Module
View websiteresponse.sh
for i in {1..50}; do echo -n "Run # $i :: ";
curl -w 'Return code: %{http_code}; Bytes Received: %{size_download};
Response Time: %{time_total}\n' https://www.insertyoururl.com -m 2 -o /dev/null -s;
done|tee /dev/tty|awk '{ sum+= $NF; n++ } END { if (n > 0) print "Average Response time =",sum / n; }'
View tlschange.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@weeyin83
weeyin83 / TLScheck.ps1
Created Apr 27, 2021
TLS Protocol Check
View TLScheck.ps1
[System.Net.ServicePointManager]::SecurityProtocol
@weeyin83
weeyin83 / migrating-to-azure-with-azure-migrate.md
Last active Apr 14, 2021
Migrating to Azure with Azure Migrate talk resources
View migrating-to-azure-with-azure-migrate.md

Migrating to Azure with Azure Migrate

Thank you to all that attending my talk at the Azurelive event, below you can find further learning resources and if you are looking to get a copy of the presentation you can download a copy here

Learn it all

Azure is vast and there is a lot of things that you as an individual need to think about as you embark on our Azure learning journey and from an organisation stand point there is a lot to think about as well. Below is some information and resources to help you on that journey.

You can sign up to an Azure Subscription with the link below. You will get $200 (US Dollars) to explore Azure for 30 days and then have access to a number of free services for 12 months.

@weeyin83
weeyin83 / scalingwithazure.md
Last active Apr 7, 2021
Scaling with Azure
View scalingwithazure.md

Learn it all

Azure is vast and there is a lot of things that you as an individual need to think about as you embark on our Azure learning journey and from an organisation stand point there is a lot to think about as well. Below is some information and resources to help you on that journey.

You can sign up to an Azure Subscription with the link below. You will get $200 (US Dollars) to explore Azure for 30 days and then have access to a number of free services for 12 months.

Azure Load Balancer

View dnsserver.ps1
#If dns_srv3 is populated do the following
If($dns_srv3) {
#This stage added the second server as a nameserver to the zones created above
$zones | foreach-object {Add-DnsServerResourceRecord -Name $_ -NameServer $dns_srv2 -NS -ZoneName $_} $zones | foreach-object {Add-DnsServerResourceRecord -Name $_ -NameServer $dns_srv3 -NS -ZoneName $_}
#Create remote session and create a copy of the zones onto the secondary server
$session = New-PSSession -ComputerName $dns_srv2 -Credential $credentials ForEach ($z in $zones) {Invoke-Command -Session $session -ScriptBlock $scriptblock -Arg @($zones,$dns_ip1,$dns_srv2,$z)}
#Create remote session and create a copy of the zones onto the third server
$session2 = New-PSSession -ComputerName $dns_srv3 -Credential $credentials ForEach ($z in $zones) {Invoke-Command -Session $session2 -ScriptBlock $scriptblock -Arg @($zones,$dns_ip1,$dns_srv2,$z,$dns_srv3)} #Remove credential file Remove-Item C:\cred.txt
#Close remote session to the second server
Remove-PSSession $Sessio
View dnscredentials.ps1
#Declare script to be run on remote server
$scriptblock = {param($zones,$dns_ip1,$dns_srv2,$z,$dns_srv3) Add-DnsServerSecondaryZone -MasterServers $dns_ip1 -Name $z -ZoneFile $z".dns"}
#Collects Credentials to connect to the remote server
$username = Read-Host -Prompt "Enter the username for the account"
Read-host -Prompt "enter password" -assecurestring | convertfrom-securestring | out-file C:\cred.txt
$password = get-content C:\cred.txt | convertto-securestring $credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "$username",$password
# This line of Powershell loops round using the inputs and creates the primary copy of the non-integrated DNS zones on the first server
View dnssetup.ps1
#This stage clears any error codes within the default error variable in Powershell
$error.clear()
#This stage looks for the server names and IP information from the engineer
$dns_srv1 = Read-Host -Prompt "Enter DNS Server Member 1"
$dns_srv2 = Read-Host -Prompt "Enter DNS Server Member 2"
$dns_srv3 = Read-Host -Prompt "Enter DNS Server Member 3"
$dns_ip1 = Read-Host -Prompt "Enter the IP address of DNS Server Member 1"
$dns_ip2 = Read-Host -Prompt "Enter the IP address of DNS Server Member 2"
$dns_ip3 = Read-Host -Prompt "Enter the IP address of DNS Server Member 3"