en-us/Getting_GitIt.walkthru.help.txt
<#
Pipeworks 1.8 includes a lot of interesting little changes. One simple one is the inclusion of a new Pipeworks manifest section, GitIt. GitIt tells Pipeworks to go collect content from GitHub. It will also make all pages within the module include the content from Git. For instance, this Pipeworks manifest would get the HTML5Shiv from GitHub #> @{ GitIt = @{ "afarkas/HTML5Shiv/dist/html5shiv.js" = "JS\html5shiv.js" } } <# This will grab the latest version of [three.js](http://mrdoob.github.io/three.js/), the JavaScript 3D Framework, and create a sample page. #> # Create a folder for the module New-Item -Path "$home\Documents\WindowsPowerShell\Modules\3Js\Pages" -ItemType Directory -ErrorAction SilentlyContinue -Force | Out-Null # Create a very minimal Pipeworks manifest @" @{ GitIt = @{ "mrdoob/three.js/build/three.min.js" = "JS\three.min.js" } } "@ | Set-Content "$home\Documents\WindowsPowerShell\Modules\3JS\3JS.Pipeworks.psd1" @' @{ ModuleVersion = 0.1 } '@ | Set-Content "$home\Documents\WindowsPowerShell\Modules\3JS\3JS.psd1" { New-WebPage -Title "3d test" -JavaScript " `$(function () { var camera, scene, renderer; var geometry, material, mesh; init(); animate(); function init() { camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 ); camera.position.z = 1000; scene = new THREE.Scene(); geometry = new THREE.CubeGeometry( 200, 200, 200 ); material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } ); mesh = new THREE.Mesh( geometry, material ); scene.add( mesh ); renderer = new THREE.CanvasRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement ); } function animate() { // note: three.js includes requestAnimationFrame shim requestAnimationFrame( animate ); mesh.rotation.x += 0.01; mesh.rotation.y += 0.02; renderer.render( scene, camera ); } }) " } | Set-Content "$home\Documents\WindowsPowerShell\Modules\3JS\Pages\Default.ps1" Import-Module 3JS -Force -PassThru | ConvertTo-ModuleService -Force -Show |