Guest User

Untitled

a guest
May 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $erroractionpreference = "Stop"
  2.  
  3. [xml]$wspaces = accurev show wspaces -fx
  4. $myFQDN=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain
  5.  
  6. function ReOriginWS($wsname, $wsstorage) {
  7. Write-Output "* checking directory '$wsstorage'"
  8. Set-Location $wsstorage
  9. try {
  10. $acinfo = accurev info 2>&1
  11. } catch {
  12. Write-Output " !! this doesn't look like anything to me !!"
  13. return
  14. }
  15. Write-Output " pulling workspace '$wsname' to '$myFQDN'"
  16. Write-Output " > workspace path is '$wsstorage'"
  17. accurev chws -w $wsname -l $wsstorage -m $myFQDN
  18. }
  19.  
  20. Push-Location
  21. try {
  22. $wspaces.AcResponse.Element | Foreach-Object {
  23. if (Test-Path $_.Storage) {
  24. if ($_.Host -ne $myFQDN) {
  25. ReOriginWS $_.Name $_.Storage
  26. }
  27. }
  28. }
  29. } finally {
  30. Pop-Location
  31. }
Add Comment
Please, Sign In to add comment