If you want to produce a list of modules that are not supported in your current version of PowerCLI, you can run the following snippet.
$shell = New-Object -ComObject Shell.Application
Get-Module -Name 'VMware.*' -ListAvailable |
Select-Object Name, Version,
@{N = 'Date'; E = {
$script:fName = ($_.Path -replace '.psd1', '.cat')
if (Test-Path -Path $script:fName)
{
$script:folder = Split-Path -Path $script:fName -Parent
$file = Split-Path -Path $script:fName -Leaf
$sFolder = $shell.Namespace($script:folder)
$sFile = $sFolder.ParseName($file)
$sFolder.GetDetailsOf($sFile, 3)
}
else { 'na' }
}
},
@{N = 'Core'; E = {
if($_.CompatiblePSEditions -contains 'Core'){
$true
}
elseif ($_.Name -ne 'VMware.PowerCLI')
{
Test-Path -Path "$($script:folder)\netcoreapp2.0"
}
else { 'na' } }
} |
Format-Table -AutoSize
If you want to check which specific cmdlets, in modules that are supported in Core, are not supported, you can run something like this
Get-Module -Name VMware.* -ListAvailable -PipelineVariable module |
ForEach-Object -Process {
Get-ChildItem -Path $module.ModuleBase -Directory -Filter "net*" |
ForEach-Object -Process {
Get-ChildItem -Path $_.FullName -Filter "*.Cmdlets.dll-Help.xml" |
ForEach-Object -Process {
[xml]$help = Get-Content -Path $_.FullName
$help.helpItems.command |
ForEach-Object -Process {
New-Object PSObject -Property ([ordered]@{
Module = $module.Name
Cmdlet = "$($_.details.verb)-$($_.details.noun)"
Core = -not ($_.alertset.alert.para -match "This cmdlet is not supported on the Core edition of PowerShell.")
})
}
}
}
} | where { -not $_.Core } | Sort-Object -Property Module, Cmdlet