Skip to content

Instantly share code, notes, and snippets.

@RamblingCookieMonster
Created August 8, 2015 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RamblingCookieMonster/bff0d1a4604ba7a7fd23 to your computer and use it in GitHub Desktop.
Save RamblingCookieMonster/bff0d1a4604ba7a7fd23 to your computer and use it in GitHub Desktop.
zPSDeploy.CreateYourOwn.ps1
# Create a demo project
mkdir C:\MyProject
# Create some stuff to deploy
mkdir C:\MyProject\Stuff
"Important things!" | Out-File C:\MyProject\Stuff\File.txt
# Create folders to deploy this to
mkdir C:\Target
mkdir $env:USERPROFILE\T
# Create a deployments.yml file
@"
MyModuleDeployment:
Author: 'wframe'
Source:
- 'Stuff'
Destination:
- 'C:\Target\Stuff'
- '$env:USERPROFILE\T'
DeploymentType: Filesystem
"@ | Out-File C:\MyProject\deployments.yml
#######
# Load up PSDeploy, inspect the deployment!
Import-Module PSDeploy
Get-PSDeployment -Path C:\MyProject\deployments.yml
# Source : C:\MyProject\Stuff
# DeploymentType : Filesystem
# DeploymentOptions :
# Targets : C:\Target\Stuff
# C:\Users\warre\T
#Looks good, deploy!
Invoke-PSDeployment -path C:\MyProject\deployments.yml
#Verify our deployment worked:
Test-Path C:\Target\Stuff
Test-Path $env:USERPROFILE\T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment