Skip to content

Instantly share code, notes, and snippets.

View jetstreamin's full-sized avatar
:octocat:
chillin' like the vanilla shake that I am

Mike Mahon jetstreamin

:octocat:
chillin' like the vanilla shake that I am
View GitHub Profile
#https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md
# Install IIS (with Management Console)
Install-WindowsFeature -name Web-Server -IncludeManagementTools
# Install ASP.NET 4.6
Install-WindowsFeature Web-Asp-Net45
# Install Web Management Service
Install-WindowsFeature -Name Web-Mgmt-Service
@jetstreamin
jetstreamin / ExportSchema.ps1
Created August 10, 2019 23:35 — forked from cheynewallace/ExportSchema.ps1
Export MSSQL schema with PowerShell. This script will export your schema definitions for tables, stored procs, triggers, functions and views to .sql files
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>"
# Start Script
Set-ExecutionPolicy RemoteSigned
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath)
{
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
USE [master];
DECLARE @kill varchar(8000) = '';
SELECT @kill = @kill + 'kill ' + CONVERT(varchar(5), session_id) + ';'
FROM sys.dm_exec_sessions
WHERE database_id = db_id('LSST')
SELECT @kill
EXEC(@kill);
@jetstreamin
jetstreamin / gistu.txt
Created September 15, 2019 10:06
Created with Copy to Gist
# This script installs IIS and the features required to
# run West Wind Web Connection.
#
# * Make sure you run this script from a Powershel Admin Prompt!
# * Make sure Powershell Execution Policy is bypassed to run these scripts:
# * YOU MAY HAVE TO RUN THIS COMMAND PRIOR TO RUNNING THIS SCRIPT!
Set-ExecutionPolicy Bypass -Scope Process
# To list all Windows Features: dism /online /Get-Features
# Get-WindowsOptionalFeature -Online
@jetstreamin
jetstreamin / gistu.txt
Created September 15, 2019 11:37
Created with Copy to Gist
<div class="MainContainer">
<div class="ParallaxContainer">
<h1>
Aloha!
</h1>
</div>
<div class="ContentContainer">
<div class="Content">
@jetstreamin
jetstreamin / gistu.txt
Created September 15, 2019 11:37
Created with Copy to Gist
html, body {
font-family: Open Sans;
font-size: 18px;
line-height: 28px;
scroll-behavior: smooth;
}
h1 {
letter-spacing: -15px;
font-family: Open Sans;
@jetstreamin
jetstreamin / PS-Invoke-Fingerprint.ps1
Created September 16, 2019 03:17
PowerShell - Fingerprint Commands and Server Information
Write-Output 'Hello World'
$env:computername
## Function to fingerprint commands executed during the execution of this runbook
Function Invoke-Fingerprint {
param ( $cmd )
Write-Output '---------------------------'
Write-Output $cmd
Invoke-Expression $cmd
}
@jetstreamin
jetstreamin / PS-Azure-VM-GetInfo.ps1
Created September 16, 2019 03:19
Get All VM Info for an Azure Subscription
param(
[string]$tenantId="",
[string]$file="Azure-Classic-VMs.csv"
)
if ($tenantId -eq "") {
Write-Host "No tenant specified."
Add-AzureAccount
} else {
add-azureaccount -Tenant $tenantId
@jetstreamin
jetstreamin / PS-AzureAutomation.ps1
Created September 16, 2019 03:22
Azure Automation Powershell for Editing & Creating Runbooks
Install-Module AzureAutomationAuthoringToolkit -Scope CurrentUser
Import-Module AzureAutomationAuthoringToolKit
@jetstreamin
jetstreamin / m13.io.gist.txt
Created September 16, 2019 05:52
Created with Copy to Gist
//https://www.youtube.com/watch?v=dY6jR52fFWo
using System.CodeDom.Compiler;
using Microsoft.CSharp;
public class CompilerTest {
public object RunCode (string userCode) {
CSharpCodeProvider provider = new CSharpCodeProvider ();
CompilerResults results = provider.CompileAssemblyFromSource (new CompileParameters (), userCode);
System.Type classType = results.CompiledAssembly.GetType("MyClass");
System.Reflection.MethodInfo method = classType.GetMethod("MyMethod");