IIS 7 and Above
'Object reference not set to an instance of an object' error in IIS P...
Re: 'Object reference not set to an instance of an object' error in I...
Jun 11, 2009 10:05 PM|sergeia|LINK
Mike, I think what you see is the problem with access from PowerShell to your remote home holder.
In my questions when I asked to show output from 'dir iis:\sites\parentSite' I meant 'parentSite' for your vdir, i.e. in your case it is 'Default Web Site'. And I suspect that you will get the same error.
Now, when new-webvirtualdirectory is getting processed, PowerShell checks existance of its home folder. I see that you have this error:
Output for dir
Get-ChildItem : Object reference not set to an instance of an object.
It means you cannot access home folder of your new vdir, and it causes an error. Please confirm if this is the case. If it is, then it is generic issue with PowerShell access to this folder, because this command above is executed on file system provider.