Skip to content

Instantly share code, notes, and snippets.

View DamianMac's full-sized avatar
😃
Doing too much at once.

Damian Maclennan DamianMac

😃
Doing too much at once.
View GitHub Profile
@DamianMac
DamianMac / gist:8211c53211136e88e9fe
Created December 14, 2014 02:13
Set directory permissions with powershell
#create share and set permissions
New-Item -ItemType Directory $sharePathname
$inherit = [system.security.accesscontrol.InheritanceFlags]"ContainerInherit, ObjectInherit"
$propagation = [system.security.accesscontrol.PropagationFlags]"None"
$permission = 'IIS_IUSRS',"FullControl", $inherit, $propagation, "Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
@DamianMac
DamianMac / gist:6dfa55f0c4762e52ecc1
Created October 24, 2014 14:50
Find a deployment for a project and environment
var deployment = repository.Deployments.FindOne(d => d.EnvironmentId == "Environments-65" && d.ProjectId == "projects-193");
$server = "http://blah"
$apiKey = "API-XXXXXXXXXXXXXXXX"
$command = $($server + "/api/tasks")
$task = @{}
$task.Name = "Backup"
$task.Description = "Backup requested via API"
$body = $task | ConvertTo-Json