work with RAW backup plan
This commit is contained in:
@@ -31,11 +31,11 @@ Function Use-Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Import MSP360 module
|
# Import MSP360 module
|
||||||
Import-MSP360Module
|
#Import-MSP360Module
|
||||||
#Import-Module MSP360
|
Import-Module MSP360
|
||||||
|
|
||||||
# Get all backup plans
|
# Get all backup plans
|
||||||
$BackupPlans = Get-MBSBackupPlan -OutputType Full
|
$BackupPlans = Get-MBSBackupPlan -OutputType Raw | Where-Object { $_.Name -eq "TestPlan" }
|
||||||
|
|
||||||
# Iterate over all backup plans
|
# Iterate over all backup plans
|
||||||
ForEach ( $plan in $BackupPlans ) {
|
ForEach ( $plan in $BackupPlans ) {
|
||||||
@@ -82,12 +82,12 @@ ForEach ( $plan in $BackupPlans ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Get all included items from newer plan format
|
## Get all included items from newer plan format
|
||||||
If ( $null -ne $plan.BackupItem ) {
|
#If ( $null -ne $plan.BackupItem ) {
|
||||||
ForEach ( $path in $plan.BackupItem ) {
|
# ForEach ( $path in $plan.BackupItem ) {
|
||||||
Use-Path -List $IncludedPaths -Path $path
|
# Use-Path -List $IncludedPaths -Path $path
|
||||||
}
|
# }
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Get all excluded items from older plan format
|
# Get all excluded items from older plan format
|
||||||
If ( $null -ne $plan.ExcludedItems ) {
|
If ( $null -ne $plan.ExcludedItems ) {
|
||||||
@@ -98,12 +98,12 @@ ForEach ( $plan in $BackupPlans ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get all excluded items from newer plan format
|
## Get all excluded items from newer plan format
|
||||||
If ( $null -ne $plan.ExcludeItem ) {
|
#If ( $null -ne $plan.ExcludeItem ) {
|
||||||
ForEach ( $path in $plan.ExcludeItem ) {
|
# ForEach ( $path in $plan.ExcludeItem ) {
|
||||||
Use-Path -List $ExcludedPaths -Path $path
|
# Use-Path -List $ExcludedPaths -Path $path
|
||||||
}
|
# }
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Print all paths in $IncludedPaths
|
# Print all paths in $IncludedPaths
|
||||||
If ( $IncludedPaths.Length -gt 0 ) {
|
If ( $IncludedPaths.Length -gt 0 ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user