-
Notifications
You must be signed in to change notification settings - Fork 11
/
cvps.ps1
59 lines (52 loc) · 2.58 KB
/
cvps.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Package starter script for 'CommvaultPSModule Release 2.0'
#
# Package requires Powershell version 5.1
#
# Generated by: Commvault
#
# Generated on: 8/01/2019
#
# Note: Please run Install-CVModules.ps1 before using this script
# These Powershell environment preference variables are provided for reference
#$global:WhatIfPreference = $False
#$global:WhatIfPreference = $True
#$global:DebugPreference = 'SilentlyContinue'
#$global:DebugPreference = 'Continue'
#$global:VerbosePreference = 'SilentlyContinue'
#$global:VerbosePreference = 'Continue'
#$global:ErrorPreference = 'SilentlyContinue'
#$global:ErrorPreference = 'Continue'
#$Host.PrivateData.ErrorForegroundColor = 'White'
#$Host.PrivateData.VerboseForegroundColor = 'White'
#$Host.PrivateData.DebugForegroundColor = 'White'
# ----- Uncomment this section and replace <userName>, <password>, and <server> here for convenience when starting a session -----
#$Credential= New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList '<userName>',('<password>' | ConvertTo-SecureString -AsPlainText -Force)
#Connect-CVServer -Credential $Credential -Server <server>
# ----- End section -----
# ----- Comment-out or remove this section if you use the PSCredential object approach above -----
Write-Host ''
Write-Host 'Enter CommServe credentials'
[String] $Server
$Server = Read-Host 'Server'
[String] $User
$User = Read-Host 'User'
[SecureString] ${Password}
$Password = Read-Host 'Password' -AsSecureString
Connect-CVServer -Server $Server -User $User -Password $Password
# ----- End section -----
(Get-Variable -Scope Global CVConnectionPool).Value | Format-Table
# These explicit imports are not required; done here to allow display of complete package function table for visibility
Import-Module 'Commvault.CommCell'
Import-Module 'Commvault.FileSystem'
Import-Module 'Commvault.JobManager'
Import-Module 'Commvault.Policies'
Import-Module 'Commvault.RESTSession'
Import-Module 'Commvault.SQLServer'
Import-Module 'Commvault.StorageResources'
Import-Module 'Commvault.VirtualServer'
Import-Module 'Commvault.Workflow'
Get-ChildItem function: | Where-Object { $_.ModuleName -like 'Commvault.CommCell' -or $_.ModuleName -like 'Commvault.FileSystem' -or $_.ModuleName -like 'Commvault.JobManager' -or
$_.ModuleName -like 'Commvault.Policies' -or $_.ModuleName -like 'Commvault.RESTSession' -or $_.ModuleName -like 'Commvault.SQLServer' -or
$_.ModuleName -like 'Commvault.StorageResources' -or $_.ModuleName -like 'Commvault.VirtualServer' -or $_.ModuleName -like 'Commvault.Workflow' } | Sort-Object -Property Modulename
Write-Host ''