Ok, that means you have to interact with the OS running inside the VM.
There are many ways to do this;
- through the Invoke-VMScript cmdlet, but that has a limited set of OS versions on which it is supported
- via the WMI interface, provided remote WMI connectivity is enabled
- with PowerShell remoting, but that requires WinRM to be set up inside the guest OS
Once you can get something running inside the guest OS, and I skip the WMI method for now, you can use some of the available PowerShell scripts available on the different blogs.
And if you want to use the WMI method, have a look at Use PowerShell to remove local profiles
I hope this will set you on the right path