Skip to content

Commit

Permalink
Release v0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cblalexv committed Oct 21, 2020
1 parent de45ec1 commit 1561588
Show file tree
Hide file tree
Showing 46 changed files with 128 additions and 8 deletions.
18 changes: 13 additions & 5 deletions msp360.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

CompanyName = 'MSP360'

ModuleVersion = '0.8.8'
ModuleVersion = '0.9.0'

# Use the New-Guid command to generate a GUID, and copy/paste into the next line
GUID = '69079da4-a0de-426d-bece-ae139c8b5f1a'
Expand Down Expand Up @@ -49,16 +49,24 @@
# What new features, bug fixes, or deprecated features, are part of this release?
ReleaseNotes = @"
- New cmdlets:
- None
- Get-MBSPrefix cmdlet (https://kb.msp360.com/managed-backup-service/powershell-module/cmdlets/backup-agent/get-mbsprefix)
- Get-MBSDiskVolume cmdlet (https://kb.msp360.com/managed-backup-service/powershell-module/cmdlets/backup-agent/get-mbsdiskvolume)
- Features
- None
- Edit-MBSBackupPlan: Add enable/disable BitLocker option
- Add verbose messages to Get-MBSAgent, Add/Remove-MBSFirewallRules
- Add name of function in beginning of verbose messages
- Bug fix:
- Bug: Edit-MBSBackupPlan -Name does not make changes in the backup plan
- Bug: Get-MBSAPIUser - error if a user has no notification emails
- Tests:
- None
- Tests: CommonParameterSet New name, account, schedule, Pre/Post actions, retention Edit-MBSBackupPlan.CommonParameterSet New name, account, schedule, Pre/Post actions, retention
- Tests: Add-MBSUserAccount -WindowsAuthD Should not throw
- Tests: Check all tests for Should not throw
- Tests: Edit-MBSUserAccount
- Tests: Get-MBSAgentSetting
- Tests: Update-MBSStorageAccount
"@
}
}
Expand Down
2 changes: 1 addition & 1 deletion private/Convert-PSObjectToHash.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Convert-PSObjectToHash {
$hashtable = @{}
foreach( $property in $object.psobject.properties )
{
if ( $property.TypeNameOfValue -eq "System.Object[]"){
if ( $property.TypeNameOfValue -eq "System.Object[]" -and $null -ne $object."$($property.Name)"){
$hashtable[$property.Name] = $object."$($property.Name)" | ForEach-Object -Begin {$array = @()} -process {
if($_.getType().Name -in ("String","Int")){
$array += $_
Expand Down
2 changes: 1 addition & 1 deletion private/Start-MBSProcess.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Start-MBSProcess {
Default {}
}

Write-Verbose -Message "Arguments: $(((((($CMDArguments -replace '-mp "\w*"','-mp "****"') -replace '-p "\w*"','-p "****"') -replace '-cp "\w*"','-cp "****"') -replace '-c "\w*"','-c "****"') -replace '-password "\w*"','-password "****"') -replace '-ep "\w*"','-ep "****"')"
Write-Verbose -Message "$($PSCmdlet.MyInvocation.MyCommand.Name): Arguments: $(((((($CMDArguments -replace '-mp "\w*"','-mp "****"') -replace '-p "\w*"','-p "****"') -replace '-cp "\w*"','-cp "****"') -replace '-c "\w*"','-c "****"') -replace '-password "\w*"','-password "****"') -replace '-ep "\w*"','-ep "****"')"
$ProcessStartInfo.Arguments = $CMDArguments
$Process = New-Object System.Diagnostics.Process
$Process.StartInfo = $ProcessStartInfo
Expand Down
Binary file modified public/api/Add-MBSAPIUserBackupDestination.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPIAdministrator.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPICompany.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPIPackage.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPIStorageAccount.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPIUser.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSAPIUserBackupDestination.ps1
Binary file not shown.
Binary file modified public/api/Edit-MBSApiStorageAccountDestination.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIAdministrator.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIBilling.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIBuild.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPICompany.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPILicense.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIMonitoring.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIPackage.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIStorageAccount.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIUser.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIUserBackupDestination.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSAPIUserComputer.ps1
Binary file not shown.
Binary file modified public/api/Get-MBSApiStorageAccountDestination.ps1
Binary file not shown.
Binary file modified public/api/Grant-MBSAPILicense.ps1
Binary file not shown.
Binary file modified public/api/New-MBSAPIAdministrator.ps1
Binary file not shown.
Binary file modified public/api/New-MBSAPICompany.ps1
Binary file not shown.
Binary file modified public/api/New-MBSAPIPackage.ps1
Binary file not shown.
Binary file modified public/api/New-MBSAPIStorageAccount.ps1
Binary file not shown.
Binary file modified public/api/New-MBSAPIUser.ps1
Binary file not shown.
Binary file modified public/api/New-MBSApiStorageAccountDestination.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIAdministrator.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPICompany.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIComputerData.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIPackage.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIStorageAccountDestination.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIUser.ps1
Binary file not shown.
Binary file modified public/api/Remove-MBSAPIUserBackupDestination.ps1
Binary file not shown.
Binary file modified public/api/Request-MBSAPIBuild.ps1
Binary file not shown.
Binary file modified public/api/Revoke-MBSAPILicense.ps1
Binary file not shown.
Binary file modified public/cbb/Edit-MBSBackupPlan.ps1
Binary file not shown.
Binary file modified public/cbb/Get-MBSAgent.ps1
Binary file not shown.
Binary file modified public/cbb/Get-MBSBackupPlan.ps1
Binary file not shown.
112 changes: 112 additions & 0 deletions public/cbb/Get-MBSDiskVolume.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
function Get-MBSDiskVolume {
<#
.SYNOPSIS
Lists disk volumes
.DESCRIPTION
Gets the information about all disks on the current computer.
.PARAMETER All
List all disk volumes.
.PARAMETER Supported
List only supported volumes.
.PARAMETER DiskID
List volumes for the specific disk.
.PARAMETER SystemRequired
Lists only system required volumes.
.PARAMETER MasterPassword
Master password. Should be specified if configuration is protected by master password. Use -MasterPassword (ConvertTo-SecureString -string "Your_Password" -AsPlainText -Force)
.EXAMPLE
PS C:\> Get-MBSDiskVolume -Supported
Lists all supported volumes.
.EXAMPLE
PS C:\> Get-MBSDiskVolume
Lists all disk volumes.
.EXAMPLE
PS C:\> Get-MBSDiskVolume -SystemRequired
Lists system required volumes.
.EXAMPLE
PS C:\> Get-MBSDiskVolume -DiskID 3708e400-2aa4-4991-bdd8-23bf9eec6529
Lists volumes for the disk with DiskID "3708e400-2aa4-4991-bdd8-23bf9eec6529".
.INPUTS
None.
.OUTPUTS
System.Management.Automation.PSCustomObject
.NOTES
Author: Ivan Skorin
.LINK
https://kb.msp360.com/managed-backup-service/powershell-module/cmdlets/backup-agent/get-mbsdiskvolume/
#>
[CmdletBinding(DefaultParameterSetName='AllVolumes')]
param (
# Parameter - List all disk volumes
[Parameter(Mandatory=$false, HelpMessage="Lists all volumes", ParameterSetName='AllVolumes')]
[switch]
$All,
# Parameter - List only supported volumes
[Parameter(Mandatory=$true, HelpMessage="Lists only supported volumes", ParameterSetName='SupportedVolumes')]
[switch]
$Supported,
# Parameter - List volumes for the specific disk
[Parameter(Mandatory=$true, HelpMessage="Lists the volumes of the disk with that ID", ParameterSetName='DiskID')]
[Guid]
$DiskID,
# Parameter - Lists only system required volumes
[Parameter(Mandatory=$true, HelpMessage="Lists only system required volumes", ParameterSetName='SystemRequired')]
[switch]
$SystemRequired,
# Parameter - Master password
[Parameter(Mandatory=$false, HelpMessage="Specify Master password. Use -MasterPassword (ConvertTo-SecureString -string ""Your_Password"" -AsPlainText -Force)")]
[SecureString]
$MasterPassword
)

begin {
if (-not($CBB = Get-MBSAgent)) {
Break
}
try {
if ((Get-MBSAgentSetting -ErrorAction SilentlyContinue).MasterPassword -ne "" -and $null -ne (Get-MBSAgentSetting -ErrorAction SilentlyContinue).MasterPassword -and -not $MasterPassword) {
$MasterPassword = Read-Host Master Password -AsSecureString
}
}
catch {

}
}

process {
$Arguments = " listDiskVolumes"
switch ($PSCmdlet.ParameterSetName) {
'AllVolumes' { $Arguments += " -a" }
'SupportedVolumes' { $Arguments += " -s" }
'DiskID' { $Arguments += " -d $DiskID" }
'SystemRequired' { $Arguments += " -r" }
Default {}
}
$result = Start-MBSProcess -cmdpath $CBB.CBBCLIPath -cmdarguments $Arguments -output json -MasterPassword $MasterPassword
if ($result.Result -eq "Success") {
$result.Disks
}
}

end {

}
}
Binary file modified public/cbb/Get-MBSPlanHistory.ps1
Binary file not shown.
2 changes: 1 addition & 1 deletion public/cbb/New-MBSRecoveryDisk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function New-MBSRecoveryDisk {
$Arguments = 'createrecovery'
$Arguments += Set-Argument

Write-Verbose -Message $PSCmdlet.ParameterSetName
Write-Verbose -Message "$($PSCmdlet.MyInvocation.MyCommand.Name): $($PSCmdlet.ParameterSetName)"
(Start-MBSProcess -CMDPath $CBB.CBBCLIPath -CMDArguments $Arguments -Output short -MasterPassword $MasterPassword).result
}

Expand Down
Binary file modified public/cbb/Set-MBSAgentSetting.ps1
Binary file not shown.

0 comments on commit 1561588

Please sign in to comment.