Skip to content

Instantly share code, notes, and snippets.

@mattcorr
Created April 25, 2015 11:32
Show Gist options
  • Save mattcorr/b1b8a596924d41446f56 to your computer and use it in GitHub Desktop.
Save mattcorr/b1b8a596924d41446f56 to your computer and use it in GitHub Desktop.
Create-Folder runbook
workflow Create-Folder
{
param (
[parameter(Mandatory=$true)]
[PSCredential]
$VMCredential,
[parameter(Mandatory=$true)]
[Uri]
$VMUri,
[parameter(Mandatory=$true)]
[String]
$Folder
)
InlineScript {
$options = New-PSSessionOption -SkipCACheck
Invoke-Command -ConnectionUri $Using:VMUri `
-Credential $Using:VMCredential `
-SessionOption $options `
-ArgumentList $Using:Folder `
-ScriptBlock {
param ([string]$folder)
mkdir $folder
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment