Guest User

Untitled

a guest
Dec 9th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. ## Add this snippet to your profile script
  2. ## Profile script is usually found in
  3. ## c:\Users\yourname\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
  4. ## You can get the path by typing $PROFILE in a PS command prompt
  5. ##
  6. ## After adding the script to your profile, unpack the zip file in a directory
  7. ## Go to the dir in ps, and type "umbpack" then Enter (without quotes)
  8. ## Now you can find all the packages original files with their original (unpacked) names
  9. ## in the original folders
  10. function global:Build-UmbracoPackage {
  11. param($packageFile='.\package.xml')
  12. [xml]$filesInXml = Get-Content $packageFile
  13. $filesInXml.umbPackage.files.file | ForEach-Object {
  14. [string]$guidName = $_.guid
  15. [string]$newPath = $_.orgPath
  16. [string]$newName = $_.orgName
  17. $newPath = $newPath -Replace "/", "\"
  18. Write-Host ".\$guidName -> .$newPath\$newName"
  19. if (-not (Test-Path ".$newPath")) {
  20. md ".$newPath"
  21. }
  22. Copy-Item -Path ".\$guidName" -Destination ".$newPath\$newName"
  23. }
  24. }
  25. Set-Alias umbpack Build-UmbracoPackage
Add Comment
Please, Sign In to add comment