利用 Migrate for Compute Engine,您可以使用自定义模块中的命令通过 PowerShell 编写操作的脚本。本文档介绍如何在 PowerShell 模块中安装和使用内置帮助。
模块安装
- 从“下载”页面下载 Migrate for Compute Engine PowerShell 模块安装程序,或打开 Velostrata Manager 并点击首页上的 PowerShell 模块下载图标。
运行安装文件并按照向导的说明操作。您必须接受 Velostrata 最终用户服务协议并选择安装位置。
将安装以下 PowerShell 模块:
- Velostrata.PowerShell
- Velostrata.Runbook
您现在可以通过以下方式连接到 Velostrata Manager:
PS C:\Users\Demo> Import-Module Velostrata.PowerShell
PS C:\Users\Demo> Connect-VelostrataManager
脚本会提示您输入 Velostrata Manager 的 IP 地址。如果提示您输入用户名,请使用 apiuser
。密码是您在创建 Velostrata Manager 时设置的密码。
从 PowerShell 获取帮助
PowerShell 模块通过 Get-Help
命令提供帮助。
PS C:\Users\Demo> Get-help Connect-VelostrataManager
NAME
Connect-VelostrataManager
SYNOPSIS
This cmdlet establishes a connection to a Velostrata Manager Server
system.
Connect-VelostrataManager [-Server] <String> [-Username] <String>
[-Password] <SecureString> [-Port [<Int32>]]
SYNTAX
Connect-VelostrataManager [-Server] <String> [-Port <Int32>] [-Username]
<String> [-Password] <SecureString> [<CommonParameters>]
DESCRIPTION
The cmdlet starts a new session or re-establishes a previous session with
Velostrata Manager Server using the specified parameters.
When you attempt to connect to a server, the server checks for valid
credentials and then sets the relevant PSVariables.
Once the user is authenticated successfully, the session remains in effect
until the PowerShell session is closed or a new Velostrata Manager session is established.
Note: You can have only one active connection to a Velostrata Manager server
per PowerShell local session.
REMARKS
To see the examples, type: "get-help Connect-VelostrataManager -examples".
For more information, type: "get-help Connect-VelostrataManager -detailed".
For technical information, type: "get-help Connect-VelostrataManager -full".
For online help, type: "get-help Connect-VelostrataManager -online"