|
|
@ -19,6 +19,7 @@
|
|
|
|
# WANT_JSON
|
|
|
|
# WANT_JSON
|
|
|
|
# POWERSHELL_COMMON
|
|
|
|
# POWERSHELL_COMMON
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$params = Parse-Args $args;
|
|
|
|
$params = Parse-Args $args;
|
|
|
|
|
|
|
|
|
|
|
|
$result = New-Object psobject @{
|
|
|
|
$result = New-Object psobject @{
|
|
|
@ -47,7 +48,8 @@ If (-Not (Test-Path $dest -PathType Container)){
|
|
|
|
New-Item -itemtype directory -path $dest
|
|
|
|
New-Item -itemtype directory -path $dest
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Catch {
|
|
|
|
Catch {
|
|
|
|
Fail-Json $result "Error creating $dest directory"
|
|
|
|
$err_msg = $_.Exception.Message
|
|
|
|
|
|
|
|
Fail-Json $result "Error creating $dest directory! Msg: $err_msg"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -63,7 +65,8 @@ If ($ext -eq ".zip" -And $recurse -eq $false) {
|
|
|
|
$result.changed = $true
|
|
|
|
$result.changed = $true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Catch {
|
|
|
|
Catch {
|
|
|
|
Fail-Json $result "Error unzipping $src to $dest"
|
|
|
|
$err_msg = $_.Exception.Message
|
|
|
|
|
|
|
|
Fail-Json $result "Error unzipping $src to $dest! Msg: $err_msg"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# Requires PSCX
|
|
|
|
# Requires PSCX
|
|
|
@ -107,11 +110,12 @@ Else {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Catch {
|
|
|
|
Catch {
|
|
|
|
|
|
|
|
$err_msg = $_.Exception.Message
|
|
|
|
If ($recurse) {
|
|
|
|
If ($recurse) {
|
|
|
|
Fail-Json $result "Error recursively expanding $src to $dest"
|
|
|
|
Fail-Json $result "Error recursively expanding $src to $dest! Msg: $err_msg"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Else {
|
|
|
|
Else {
|
|
|
|
Fail-Json $result "Error expanding $src to $dest"
|
|
|
|
Fail-Json $result "Error expanding $src to $dest! Msg: $err_msg"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|