Hi @Limitless Technology and @Rich Matheisen
Thank you for your reply.
I tried using the double quotes for the VM name and also tried using the variable, but for me, its not working.
Export-VApp is giving me below error -
PS C:\> Get-VM -Name "Windows 10_ltsc_test_01" | Export-VApp -Destination $downloadPath -Format OVA -force
Export-VApp : 9/8/2021 1:24:59 PM Export-VApp Object reference not set to an instance of an object.
At line:1 char:42
+ ... _test_01" | Export-VApp -Destination $downloadPath -Format OVA -force ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Export-VApp], ViError
+ FullyQualifiedErrorId : Client20_NfcLease_RunNfcTask_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.ExportVApp
PS C:\> Export-VApp -VM "Windows 10_ltsc_test_01" -Destination $downloadPath -Format OVA -force
Export-VApp : 9/8/2021 1:31:10 PM Export-VApp Object reference not set to an instance of an object.
At line:1 char:1
+ Export-VApp -VM "Windows 10_ltsc_test_01" -Destination $downloadPath ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Export-VApp], ViError
+ FullyQualifiedErrorId : Client20_NfcLease_RunNfcTask_Error,VMware.VimAutomation.ViCore.Cmdlets.Commands.ExportVApp
Please suggest if I am doing anything wrong.