Created
April 25, 2015 11:32
-
-
Save mattcorr/b1b8a596924d41446f56 to your computer and use it in GitHub Desktop.
Create-Folder runbook
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
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