Skip to content

Instantly share code, notes, and snippets.

@kmondesir
kmondesir / SetAppPoolIdentity.ps1
Created August 24, 2022 02:20
Sets the Identity of Application Pool
Import-Module WebAdministration
# Please set password as an environment variable on the server
Set-ItemProperty IIS:\AppPools\$app -name processModel -value @{userName=$username;password=$password}
@kmondesir
kmondesir / systems.ps1
Created August 20, 2022 01:27
System setup
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install firefox google-chrome-x64 git vscode python postman poshgit zoom adobereader notion obs-studio lastpass handbrake vlc --yes
@kmondesir
kmondesir / getvCenterFromVM
Last active July 3, 2021 14:17
Get the vCenter Server from the virtual machine name
# https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-vCenter-name-for-VM/td-p/318609
New-VIProperty -Name vCenterServer -ObjectType VirtualMachine -Value {$Args[0].Uid.Split(":")[0].Split("@")[1]}
Get-vm YourVMName | Select-Object -Property Name,vCenterServer
@kmondesir
kmondesir / create file
Created January 14, 2021 22:37
create file
fsutil file createnew d:\test.txt 85,899,345,920
####################################################
#
# PowerShell CSV to SQL Import Script
#
####################################################
# Writes contents of a csv file to a table
# https://gallery.technet.microsoft.com/scriptcenter/Import-Large-CSVs-into-SQL-216223d9
# Ticket: SDSK 1130300760
# Author: Kino Mondesir
$elapsed = [System.Diagnostics.Stopwatch]::StartNew()
choco install googlechrome adobereader anaconda git vscode microsoft-windows-terminal firefox nordvpn zoom lastpass -y
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Make sure to run as admin
Set-Item wsman:\localhost\Client\TrustedHosts -Value "hostname"