Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $erroractionpreference = "Stop"
- [xml]$wspaces = accurev show wspaces -fx
- $myFQDN=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain
- function ReOriginWS($wsname, $wsstorage) {
- Write-Output "* checking directory '$wsstorage'"
- Set-Location $wsstorage
- try {
- $acinfo = accurev info 2>&1
- } catch {
- Write-Output " !! this doesn't look like anything to me !!"
- return
- }
- Write-Output " pulling workspace '$wsname' to '$myFQDN'"
- Write-Output " > workspace path is '$wsstorage'"
- accurev chws -w $wsname -l $wsstorage -m $myFQDN
- }
- Push-Location
- try {
- $wspaces.AcResponse.Element | Foreach-Object {
- if (Test-Path $_.Storage) {
- if ($_.Host -ne $myFQDN) {
- ReOriginWS $_.Name $_.Storage
- }
- }
- }
- } finally {
- Pop-Location
- }
Add Comment
Please, Sign In to add comment