Skip to content

Instantly share code, notes, and snippets.

View inSreeMan's full-sized avatar

smione inSreeMan

View GitHub Profile
@inSreeMan
inSreeMan / Save-KBFile.ps1
Created February 12, 2021 14:27 — forked from potatoqualitee/Save-KBFile.ps1
Download Windows patch files / KB (patchid like KBxxxxx) and save them to disk using PowerShell
function Save-KBFile {
<#
.SYNOPSIS
Downloads patches from Microsoft
.DESCRIPTION
Downloads patches from Microsoft
.PARAMETER Name
The KB name or number. For example, KB4057119 or 4057119.
@inSreeMan
inSreeMan / bashParamMapTemplate.sh
Created March 16, 2019 13:23
This template can be used for adding at the beginning of a new bash script to provide features for handling parameters/validating mandatory params similar to the PowerShell scripts. Also adds support for displaying verbose,warning,error messages like ps
#!/bin/bash
# -------------------- smScript-Bash script param mapping template ver 1.0.0 (2019.Mar)-------------------------
# synopsis : This template can be used for adding at the beginning of a new bash script to provide features for handling parameters/validating mandatory params
# similar to the PowerShell scripts. Also adds support for displaying verbose,warning,error messages like ps
# Error action can be implemented by checking retval after necessary operations (search for #logic within this script on how to implement)
#
#ctrl 1. specify the mandatory parameter names within () separated by space in longOption/shortOption format. example mandatoryParams=(directory/d section/s)
#note : short option and long option both accept -/--. The idea is to make passing the params simple.(And not to follow bash standards.Feel free to modify; if it's a must)
mandatoryParams=(directory/d section/s)
#
#Requires -RunAsAdministrator
#
#load globals for this lab
& "$PSScriptRoot\set-globals.ps1" -LabName linuxHVM
#example : $dcred = Get-LabCred DomainAdmin
function Create-LinuxVmOnHyperV {
<#
.Synopsis
Create-LinuxVmOnHyperV