-
-
Save RamblingCookieMonster/bff0d1a4604ba7a7fd23 to your computer and use it in GitHub Desktop.
zPSDeploy.CreateYourOwn.ps1
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
# 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