set parameters explicitly (#2221)

This commit is contained in:
Mikhail Timofeev
2020-12-09 10:11:53 +03:00
committed by GitHub
parent bcfa5eb226
commit b392aa60bd
4 changed files with 15 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ param(
Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
# Connection to a vCenter Server system # Connection to a vCenter Server system
Connect-VCServer Connect-VCServer -VIServer $VIServer -VIUserName $VIUserName -VIPassword $VIPassword
# Check vm clone status # Check vm clone status
$chainId = (Get-VIEvent -Entity $VMName).ChainId $chainId = (Get-VIEvent -Entity $VMName).ChainId

View File

@@ -6,6 +6,18 @@ Helper functions to use in images.CI scripts
Function Connect-VCServer Function Connect-VCServer
{ {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[System.String]$VIUserName,
[Parameter(Mandatory)]
[System.String]$VIPassword,
[Parameter(Mandatory)]
[System.String]$VIServer
)
try try
{ {
# Preference # Preference

View File

@@ -46,7 +46,7 @@ param(
Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
# Connection to a vCenter Server system # Connection to a vCenter Server system
Connect-VCServer Connect-VCServer -VIServer $VIServer -VIUserName $VIUserName -VIPassword $VIPassword
# Clear previously assigned tag with VM Name # Clear previously assigned tag with VM Name
try { try {

View File

@@ -99,7 +99,7 @@ function Select-DataStore {
} }
# Connection to a vCenter Server system # Connection to a vCenter Server system
Connect-VCServer Connect-VCServer -VIServer $VIServer -VIUserName $VIUserName -VIPassword $VIPassword
# Get a target datastore for current deployment # Get a target datastore for current deployment
Select-DataStore -VMName $VMName -TagCategory $TagCategory Select-DataStore -VMName $VMName -TagCategory $TagCategory