Initial commit of VMware.VCGChecker module

This commit is contained in:
Zhoulin Dai
2018-11-19 22:41:26 +08:00
parent ed5b8eaf5e
commit 0743c67799
7 changed files with 1795 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
Function Save-VCGJsonFile{
Param(
[Parameter(Mandatory=$true)] $FileName,
[Parameter(Mandatory=$true)] $Data,
[Parameter(Mandatory=$true)] $Dir
)
$json = @()
$Data | ForEach-Object { $json += $_.to_jsonobj()}
if (!(Test-Path $Dir)) {
New-Item -Type directory -Confirm:$false -Path $Dir -Force |Out-Null
}
$Path= $Dir + '\' + $FileName + '.json'
info ("Saving data to " + $Path)
ConvertTo-Json -Depth 10 -Compress $json | Out-File -encoding 'UTF8' -FilePath $Path
}