Skip to content

Instantly share code, notes, and snippets.

View davidlu1001's full-sized avatar

David Lu davidlu1001

View GitHub Profile
@davidlu1001
davidlu1001 / Manage-IISAppPools.ps1
Last active August 8, 2024 10:29
IIS Application Pool Management
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$iisAppPoolPattern = "LoanAlterations*",
[Parameter(Mandatory=$false)]
[string]$computerName = $env:COMPUTERNAME,
[Parameter(Mandatory=$false)]
[int]$maxWaitTime = 30,
@davidlu1001
davidlu1001 / FileMover.ps1
Last active August 23, 2024 05:30
File Mover
[CmdletBinding(SupportsShouldProcess=$true)]
Param(
[Parameter(Mandatory=$false)]
[string]$ConfigFile,
[Parameter(Mandatory=$false)]
[ValidateScript({Test-Path $_ -PathType Container})]
[string]$SourceFolder,
[Parameter(Mandatory=$false)]
@davidlu1001
davidlu1001 / Install-EdgeEnterprise.ps1
Created July 25, 2024 11:33
Install EdgeEnterprise
<#
.SYNOPSIS
Installs or updates Microsoft Edge Enterprise x64 package.
.DESCRIPTION
This script checks the local Edge version, compares it with the downloaded version,
and installs the new version if it's newer. It handles process termination and various installation scenarios.
.PARAMETER InstallerPath
The path to the Microsoft Edge MSI installer. Default is "C:\temp\scripts\MicrosoftEdgeEnterpriseX64.msi".
@davidlu1001
davidlu1001 / Download-EdgeEnterprise.ps1
Created July 25, 2024 11:32
Download EdgeEnterprise
<#
.SYNOPSIS
Downloads the latest Microsoft Edge Enterprise offline x64 package for Windows Server with optimized speed and reliability.
.DESCRIPTION
This script checks the local Edge version, compares it with the latest available version,
and downloads the package if necessary. It uses optimized download methods for better speed and includes robust error handling.
.PARAMETER DownloadDir
The directory where the Edge package will be downloaded. Default is "C:\temp\scripts".
@davidlu1001
davidlu1001 / Analysis_Improvement_CrowdStrike_BSOD.md
Last active July 24, 2024 07:44
Analysis and Improvement Strategies for CrowdStrike BSOD issue
@davidlu1001
davidlu1001 / Get-EventLogSummary.ps1
Created July 23, 2024 02:13
Get EventLog Summary with latest message
<#
.SYNOPSIS
Retrieves and summarizes Event Log data from local or remote machines.
.DESCRIPTION
This script retrieves Event Log data from specified machines, groups the events,
and provides a summary including count and the latest message for each group.
.PARAMETER ComputerName
Specifies the target computers. Default is the local machine.
@davidlu1001
davidlu1001 / manage_vm_snapshot.py
Last active July 22, 2024 10:58
Manage VM Snapshot
import argparse
import time
from playwright.sync_api import Playwright, sync_playwright, expect, TimeoutError
import logging
import sys
import os
from dotenv import load_dotenv
import configparser
from typing import List, Tuple, Dict, Any
#from tqdm import tqdm
@davidlu1001
davidlu1001 / manageVMSnapshots.ps1
Created July 9, 2024 10:10
Manage VM Snapshots
<#
.SYNOPSIS
Automates snapshot management for virtual machines.
.DESCRIPTION
This script automates the process of creating and managing snapshots for virtual machines
in a web-based management interface. It is compatible with PowerShell V5 and does not rely on external WebDriver dependencies.
.NOTES
File Name : manageVMSnapshots.ps1
Author : [Your Name]
[CmdletBinding()]
param (
[Parameter(Mandatory = $false)]
[string]$OldNewDnsFile = "dns_old_new.csv",
[Parameter(Mandatory = $false)]
[string[]]$ComputerNames = @("localhost"),
[Parameter(Mandatory = $false)]
[string]$OutputFile = "updateIISBindingsResult.csv",