This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const aws = require('aws-sdk'); | |
const s3 = new aws.S3({ apiVersion: '2006-03-01' }); | |
const readline = require('readline'); | |
exports.handler = async (event, context, callback) => { | |
const bucket = event.Records[0].s3.bucket.name; | |
const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' ')); | |
const params = { | |
Bucket: bucket, | |
Key: key, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Run the TSQL query on a SQL Server instance and return the query results. Use SELECT rather than PRINT to get output. | |
.Description | |
Run the TSQL query on a SQL Server instance and return the query results. Use SELECT rather than PRINT to get output. | |
#> | |
function Invoke-SqlQuery([string]$ComputerName = $Env:COMPUTERNAME, | |
[string]$InstanceName = "MSSQLSERVER", | |
[string]$Database = [System.String]::Empty, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UpdateXml([string]$InputFile = $(Throw "Please provide a path to the input XML file in the InputFile parameter."), | |
[string]$OutputFile = $InputFile, | |
[string]$ParentXPath = $(Throw "Please provide an XPath expression to where you want to append/edit a child XML element in the ParentXPath parameter."), | |
[string]$ElementName = $(Throw "Please provide the name of the XML element to append/edit."), | |
[string]$ElementAttributeName, | |
[string]$ElementAttributeValue) | |
{ | |
if (Test-Path -Path $InputFile) | |
{ | |
Write-Log "Loading XML document from file: $InputFile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Configure-IISAppPoolMaxMemory([string]$AppPoolName = "ApplicationPoolDefaults", | |
[int]$MaxMem = 20) | |
{ | |
[int]$ExitCode = 0 | |
# Ensure WebAdministration module is loaded. | |
if ((Get-Module -Name WebAdministration) -eq $null) | |
{ | |
Write-Log "Importing module: WebAdministration" | |
Import-Module -Name WebAdministration -ErrorAction SilentlyContinue | Write-Log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Configure-IE | |
{ | |
Write-Log "Disabling IE first run customize prompts" | |
$RegPath = "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" | |
New-RegKey $RegPath | |
Write-Log (New-ItemProperty -Path $RegPath -Name "DisableFirstRunCustomize" -Value 1 -PropertyType "DWORD" -Force) | |
$RegPath = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Internet Explorer\Main" | |
New-RegKey $RegPath | |
Write-Log (New-ItemProperty -Path $RegPath -Name "DisableFirstRunCustomize" -Value 1 -PropertyType "DWORD" -Force) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable extraneous services on Server 2016 Desktop Experience | |
# https://blogs.technet.microsoft.com/secguide/2017/05/29/guidance-on-disabling-system-services-on-windows-server-2016-with-desktop-experience/ | |
Configuration DisablingServicesOnServer2016wDE | |
{ | |
param( | |
[String]$ComputerName = "localhost", | |
[ValidateSet('ShouldBeDisabledOnly','ShouldBeDisabledAndDefaultOnly','OKToDisable','OKToDisablePrinter','OKToDisableDC')] | |
[String]$Level = 'OKToDisable' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Disable-UAC | |
{ | |
Write-Log "Disabling User Access Control (UAC)..." | |
$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" | |
New-RegKey $RegPath | |
Write-Log (New-ItemProperty -Path $RegPath -Name "EnableLUA" -Value 0 -PropertyType "DWORD" -Force) | |
Write-Log (New-ItemProperty -Path $RegPath -Name "ConsentPromptBehaviorAdmin" -Value 0 -PropertyType "DWORD" -Force) | |
Write-Log ("Disabling User Access Control (UAC) complete.") | |
return $true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-AsyncResult { | |
[CmdletBinding()] | |
[OutputType('Object')] | |
param ( | |
[Parameter(Mandatory = $true, Position = 1)] | |
[object] $Task | |
) | |
Write-PSFMessage -Level Verbose -Message "Building the Task Waiter and start waiting." -Target $Task | |
$Task.GetAwaiter().GetResult() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.NOTES | |
Name: Oracle.psm1 | |
Author: Immanuel Smits | |
Version History: | |
1.0 - 7/12/2016 - Initial Release. | |
.SYNOPSIS | |
Module to provide database access to PowerShell | |
.DESCRIPTION | |
Expanded description of what the script does. |
NewerOlder