Files
PowerCLI-Example-Scripts/Modules/SRM/Meadowcroft.Srm.Storage.ps1
dmilov fb641c8a1c License PowerCLI-Examples-Scripts repository under BSD-2 Clause (#462)
As part of the VMware open source program, we have to update this repository with the correct license and copyright information.
We add the BSD-2 Clause License for this repository.
We mark all source code provided by VMware with the Copyright notice under BSD-2 Clause license.

* Update repository license to BSD 2-Clause License

* Update Copyright
2021-06-07 09:58:47 +03:00

34 lines
881 B
PowerShell

<#
Copyright 2017-2021 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
#>
<#
Copyright 2021 VMware, Inc.
SPDX-License-Identifier: BSD-2-Clause
#>
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
<#
.SYNOPSIS
Trigger Discover Devices for Site Recovery Manager
.OUTPUTS
Returns discover devices task
#>
Function Start-DiscoverDevice {
[cmdletbinding(SupportsShouldProcess=$True, ConfirmImpact="Medium")]
[OutputType([VMware.VimAutomation.Srm.Views.DiscoverDevicesTask])]
Param(
[VMware.VimAutomation.Srm.Types.V1.SrmServer] $SrmServer
)
$api = Get-ServerApiEndpoint -SrmServer $SrmServer
$name = $SrmServer.Name
[VMware.VimAutomation.Srm.Views.DiscoverDevicesTask] $task = $null
if ($pscmdlet.ShouldProcess($name, "Rescan Storage Devices")) {
$task = $api.Storage.DiscoverDevices()
}
return $task
}