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