Posts

Showing posts from December 7, 2025

✅ Step-by-Step: Create & Install Self-Signed Certificate in PowerShell

✅ Step-by-Step: Create & Install Self-Signed Certificate in PowerShell 🟦 Step 1: Open PowerShell as Administrator 1. Click Start 2. Search PowerShell 3. Right-click → Run as Administrator 🟦 Step 2: Create a Self-Signed Certificate Use this command: New-SelfSignedCertificate -DnsName "test.local" -CertStoreLocation "Cert:\LocalMachine\My" 🔍 What this does: Generates a certificate for domain test.local Saves it under Local Machine → Personal → Certificates 🟦 Step 3: Export Certificate With Private Key (Optional) If you want a .pfx (for IIS / apps), run: 3.1 Set a password $mypwd = ConvertTo-SecureString -String "P@ssw0rd123" -Force -AsPlainText 3.2 Export to PFX Export-PfxCertificate -Cert "Cert:\LocalMachine\My\<Thumbprint>" ` -FilePath "C:\certs\mycert.pfx" -Password $mypwd 👉 Replace <Thumbprint> with your certificate’s real thumbprint: Get-ChildItem Cert:\LocalMachine\My 🟦 Step 4: Export .CER (For Trusted Root Ins...

PowerShell Script: Install-SQLServer

PowerShell Script: Install-SQLServer.ps1 # PowerShell Script: Install-SQLServer.ps1 # Purpose: Fully automate SQL Server and SSMS installation # --- Variables --- $SQLDownloadURL = "https://go.microsoft.com/fwlink/?linkid=866658" # SQL 2022 Developer $SSMSDownloadURL = "https://aka.ms/ssmsfullsetup" $SQLInstaller = "C:\SQLServer2022.exe" $SQLMediaPath = "C:\SQLSetup" $ConfigFile = "C:\SQLSetup\ConfigurationFile.ini" $SSMSInstaller = "C:\SSMSSetup.exe" # --- Step 1: Download installers --- Write-Host "Downloading SQL Server..." Invoke-WebRequest -Uri $SQLDownloadURL -OutFile $SQLInstaller Write-Host "Downloading SSMS..." Invoke-WebRequest -Uri $SSMSDownloadURL -OutFile $SSMSInstaller # --- Step 2: Extract SQL Server setup files --- Write-Host "Extracting SQL Server installer..." Start-Process -FilePath $SQLInstaller -ArgumentList "/ACTION=Download /MEDIAPATH=$SQLMediaPath /QUIET" -Wait ...