From 560739222dae6638a0612f33cfa3607b62b8da72 Mon Sep 17 00:00:00 2001 From: Zhoulin Dai Date: Fri, 30 Nov 2018 17:15:13 +0800 Subject: [PATCH] Fix bugs --- .../VMware.VCGChecker/Export-VCGReport.ps1 | 14 ++++++------ Modules/VMware.VCGChecker/Get-VCGStatus.ps1 | 2 +- Modules/VMware.VCGChecker/README.md | 22 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Modules/VMware.VCGChecker/Export-VCGReport.ps1 b/Modules/VMware.VCGChecker/Export-VCGReport.ps1 index 1b1253d..3774915 100644 --- a/Modules/VMware.VCGChecker/Export-VCGReport.ps1 +++ b/Modules/VMware.VCGChecker/Export-VCGReport.ps1 @@ -140,10 +140,10 @@ Function Generate_HtmlReport($Data, $Dir) { $dataTime = Get-Date -Format 'yyyy-M-d_h-m' $vcName = vcName($Data) $filename = 'compreport_' + $vcName + $dataTime + '.html' - $filePath = $Dir + $filename + $filePath = $Dir + '\' + $filename #save report $content |Out-File -FilePath $filePath -Encoding utf8| Out-Null - info ("Report " + "'" + $Dir + $filename + "'" + " has been created!") + info ("Report " + "'" + $filePath + "'" + " has been created!") } Function Generate_SummaryReport($Data, $Dir) { @@ -440,10 +440,10 @@ Function Generate_SummaryReport($Data, $Dir) { $dataTime = Get-Date -Format 'yyyy-M-d_h-m' $vcName = vcName($Data) $filename = 'sumreport_' + $vcName + $dataTime + '.html' - $filePath = $Dir + $filename + $filePath = $Dir + '\' + $filename # Out-put a html report $content |Out-File -FilePath $filePath -Encoding utf8| Out-Null - info ("Report " + "'" + $Dir + $filename + "'" + " has been created!") + info ("Report " + "'" + $filePath + "'" + " has been created!") } Function Generate_CsvReport($Data, $Dir) { @@ -542,9 +542,9 @@ Function Generate_CsvReport($Data, $Dir) { $dataTime = Get-Date -Format 'yyyy-M-d_h-m' $vcName = vcName($Data) $filename = 'compreport_' + $vcName + $dataTime + '.csv' - $filePath = $Dir + $filename + $filePath = $Dir + '\' + $filename #save csv report - info ("Report " + "'" + $Dir + $filename + "'" + " has been created!") + info ("Report " + "'" + $filePath + "'" + " has been created!") $content |Out-File -FilePath $filePath -Encoding utf8| Out-Null return $content } @@ -785,7 +785,7 @@ $summaryHead = @' height: 100%; background-size: cover; background-repeat: no-repeat; - background-image: url(https://myvmware.workspaceair.com:443/SAAS/jersey/manager/api/images/510495) + background-image: url(https://myvmware.workspaceair.com/SAAS/jersey/manager/api/images/520470) } #header{ margin: 0 auto; diff --git a/Modules/VMware.VCGChecker/Get-VCGStatus.ps1 b/Modules/VMware.VCGChecker/Get-VCGStatus.ps1 index 0f7a5de..426d6ce 100644 --- a/Modules/VMware.VCGChecker/Get-VCGStatus.ps1 +++ b/Modules/VMware.VCGChecker/Get-VCGStatus.ps1 @@ -13,7 +13,7 @@ $apiQurryDict=@{} # Function PingApiServer(){ $apiServerIp='apigw.vmware.com' - $results =Test-NetConnection $apiServerIp -InformationLevel 'Quiet' + $results =Test-Connection $apiServerIp -Quiet if($results -ne $true){ error ("Failed to access VMware Compatibility API, Unable to use comparison function, only view basic hardware information; diff --git a/Modules/VMware.VCGChecker/README.md b/Modules/VMware.VCGChecker/README.md index a38c064..79007d4 100644 --- a/Modules/VMware.VCGChecker/README.md +++ b/Modules/VMware.VCGChecker/README.md @@ -19,23 +19,23 @@ Considering many data center may have control on internet access, we create 3 cm * Get-VCGStatus: cmdlet to check hardware compatibility by query VCG website * Export-VCGReport: cmdlet to export the summary/html/csv reports -1. You need to first import this module after you import PowerCLI module -PS> Import-Module +1. You need to first import this module after you import PowerCLI module +PS> Import-Module <path_to_VMware.VCGChecker.psd1> -2. Connect to the target vSphere hosts using Connect-VIServer and get VMHosts -PS> Connect-VIServer -Server -User -Password +2. Connect to the target vSphere hosts using Connect-VIServer and get VMHosts +PS> Connect-VIServer -Server <server> -User <username> -Password <password> PS> $vmhosts = Get-VMHost -3. Collect the hardware data -PS> $hwdata = Get-VCGHWInfo -vmHosts $vmhosts +3. Collect the hardware data +PS> $hwdata = Get-VCGHWInfo -vmHosts $vmhosts Note: if you don't have internet access, you need to connect your client to internet before proceeding to the next step. -4. Specify the target vSphere release you want to check and submit the hardware data to VMware website -PS> $vcgdata= Get-VCGStatus -Data $hwdata -Version '' +4. Specify the target vSphere release you want to check and submit the hardware data to VMware website +PS> $vcgdata= Get-VCGStatus -Data $hwdata -Version '<release>' -5. Save the compatibility reports -PS> Export-VCGReport -Data $vcgdata -Dir +5. Save the compatibility reports +PS> Export-VCGReport -Data $vcgdata -Dir <dir> # Known Limitation * The module is not able to get the firmware version for HBA devices. -* The module is not able to get the HDD/SSD data. \ No newline at end of file +* The module is not able to get the HDD/SSD data.