Skip to content

Instantly share code, notes, and snippets.

@fearthecowboy
fearthecowboy / elevate.ps1
Last active September 3, 2019 11:34
Better elevation script for powershell
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
[master]
config_version = git --work-tree=$confdir/environments/$environment/ --git-dir=/$confdir/environments/$environment/.git/ log --short -n 1
# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@ptinsley
ptinsley / gist:5348192
Created April 9, 2013 18:35
Puppet grant ftp access to user in IIS
exec { "Grant FTP Access to ${username}": # Grant access to our user
command => "C:\Windows\System32\inetsrv\appcmd.exe set config \"${site_name}\" /section:system.ftpServer/security/authorization /+\"[accessType='Allow',users='${username}',permissions='Read, Write']\" /commit:apphost",
unless => "cmd.exe /c C:\Windows\System32\inetsrv\appcmd.exe list config \"${site_name}\" /section:system.ftpServer/security/authorization | find \"${username}\"",
path => $::path,
require => [ User[$username], Iis_vdir["${site_name}/"] ],
}