Try replacing this line
if($key -notmatch $excludeFilter){
with
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is script2 producing an empty .xlsx file?
Can you add the -Verbose switch on script2?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes LucD,
script2 generates empty .xlsx file.
I am not sure, how to add -verbose to the script2, please help
Is it as below
Get-Datastore | Get-VmwOrphan | Export-Excel $reportlocation -AutoFilter -AutoSize -WorksheetName Orphaned_VMDKs -Verbose
LucD,
If I use Get-Datastore | Get-VmwOrphan | Export-Excel $reportlocation -AutoFilter -AutoSize -WorksheetName Orphaned_VMDKs -Verbose
I am getting the output as
I mean
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Please find the verbose log from script2 is attached.
I have recently removed a VM by name demotest1 from inventory and deleted all the files expect demotest1.vmdk
but when a report, still i am not able to get the zombie disk of demotest1
When I run the script1 with versbose, it identifies the zombie disk of demotest1
verbose output of script1
PS D:\Mine\Work Related\myreports4.0\Orphaned_VMDK> .\script1.ps1
VERBOSE: 06-01-2020 14:41:52 Get-View Finished execution
VERBOSE: 06-01-2020 14:41:54 Get-VM Finished execution
VERBOSE: 06-01-2020 14:41:55 Get-Template Finished execution
VERBOSE: 06-01-2020 14:41:56 Get-View Finished execution
VERBOSE: 06-01-2020 14:42:05 Get-VM Finished execution
VERBOSE: 06-01-2020 14:42:07 Get-Template Finished execution
VERBOSE: 06-01-2020 14:42:08 Get-View Finished execution
VERBOSE: 06-01-2020 14:42:15 Get-VM Finished execution
VERBOSE: 06-01-2020 14:42:16 Get-Template Finished execution
VERBOSE: 06-01-2020 14:42:18 Get-View Finished execution
VERBOSE: 06-01-2020 14:42:22 Get-VM Finished execution
VERBOSE: 06-01-2020 14:42:22 Get-Template Finished execution
VERBOSE: 06-01-2020 14:42:24 Get-View Finished execution
and verbose output in script1 xlsx file
Try replacing this line
if($key -notmatch $excludeFilter){
with
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
perfect LucD. That worked perfectly
Thank you very much.
I am new to Powershell scripting, so I apologize if my question sounds too elementary for this forum. I am attempting to locate orphan files in my VMware Environment and am trying to use this script. However, how do I connect to my virtual center server and login? Do I have to replace any of the text within this script for my environment. For example, do I have to run this for each datastore and is there a place within the script that I have to type in the datastore name? Again, I'm sorry for the silly questions. Any assistance you can provide will be appreciated. Thank you.