I understand I can use diskpart /s
to script diskpart
select vdisk file=FILE_SUPPLIED_BY_COMMAND_LIME_PARAMETER
attach vdisk readonly
compact vdisk
detach vdisk
exit
And then run it with:
diskpart /s scriptname.txt /t 15
But can I add command lime parameters to diskpart? Eg so I can specify the VHDX file by the command line?
If that's not possible, faking command line parameters with a Powershell wrapper to make the diskpart script dynamically might also be an option.