Skip to content

Instantly share code, notes, and snippets.

View crshnbrn66's full-sized avatar

Thom Schumacher crshnbrn66

View GitHub Profile
param
(
[String]
[Parameter(Mandatory)]
$SourceFolder,
[String]
$Destination ,
[string]
$AdminUserName,
[string]
#requires -version 5.0
using namespace System.IO
using namespace System.IO.Compression
param(
[Parameter(Mandatory=$true)][string]$sourceZip,
[Parameter(Mandatory=$true)][string]$destPath
)
add-type -assemblyname 'System.IO.Compression'
add-type -assemblyname 'System.IO.Compression.FileSystem'
@crshnbrn66
crshnbrn66 / AzureAlertEmail.psm1
Last active June 13, 2018 13:19
added more functions
function Update-PAzureAlertEmail
{
<#
.SYNOPSIS
This function either adds or removes an email from Alerts in azure
.DESCRIPTION
This function will remove the enclosed email from all the alerts in an azure subscription.
If ADD is specified it will add the email to the all the alerts in an azure subscription.
When this function is called it will return an object of the items that were added or removed.
.EXAMPLE
#------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 9ad32074-7adb-4822-a049-93600f966aa9
# Source File: ..\Documents\SAPIEN\Projects\Gui-SSRS-Deploy\Gui-SSRS-Deploy.psproj
#------------------------------------------------------------------------
#region Project Recovery Data (DO NOT MODIFY)
<#RecoveryData:
CAIAAB+LCAAAAAAABACNkV1rgzAUhu8L/Q/ifepHxU6IuVhdyy72QS27Had6HBkxkUTH/PeLU4dl
MHb5JO95XnJCT1ioD9R9Bi2w9cpx6LNW71i032DxBbXhSrJgE1BvhunuwAXeZyyBchv6u4jsoLyQ
6CYMCfhRQpJt7PtVEscACfWm8DQ6tZz7BplPvSXOciVKW+d4yzYzwYTOCSvUKAt8hBpT13VuOy7K
# SQLReporting.psm1 Version 0.9
# Written by Trond Hindenes
#http://hindenes.com/powershell/SQLReporting.psm1
#Import-Module Pester
#http://stackoverflow.com/questions/9178685/change-datasource-of-ssrs-report-with-powershell
<#
.SYNOPSIS
Gets SSRS instances on ComputerName
.DESCRIPTION
@crshnbrn66
crshnbrn66 / Compare-iisSites.ps1
Last active June 16, 2020 11:04
Retrieves IIS settings from remote machines and presents difference view in winmerge
#Requires -Modules webadministration
#Requires -RunAsAdministrator
#Requires -version 3.0
<#
.SYNOPSIS
Provides a means to get the current backup location for iis changes
.DESCRIPTION
Changes made to the IIS instance are recorded in a history config file. This function provides the means to retreive where it is on the machine
#http://www.iis.net/learn/extensions/configuring-application-request-routing-(arr)/achieving-high-availability-and-scalability-arr-and-nlb
# This script is used in octopus to deploy ARR to host targetted for it.
#
function stop-WAS
{
$i = 0
$service = get-service WAS -ErrorAction SilentlyContinue
if($service)
{
@crshnbrn66
crshnbrn66 / SQLJob.ps1
Last active January 11, 2016 16:51
Script to create Sql jobs / query them and steps
#http://sqlblog.com/blogs/allen_white/archive/2008/01/09/create-agent-jobs-to-run-powershell-scripts.aspx
#https://msdn.microsoft.com/en-us/library/ms162162.aspx
#Requires -Version 3.0
function Get-SqlJobs
{
param([string]$sqlServer, [string]$sqlinstance = $null)
$s = New-SqlServerConnection -sqlServer $sqlServer -sqlinstance $sqlinstance
$jobs = $s.JobServer.Jobs
$jobs
}
function Test-FileOpen
{
<#
.SYNOPSIS
Tests to see if a file is locked
.DESCRIPTION
Returns true if the file can be opened. False if the file is open already.
.PARAMETER path to file
# http://stackoverflow.com/a/13519264
#http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesystemrights%28v=vs.110%29.aspx
function Remove-PermissionsForGroup
{
<#
.Synopsis
Removes Ntfs permissions for the directory specified..
.DESCRIPTION
This script sets the ntfs permissions for the directory passed.