Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Mount-DiskImage in a remote session exeception- Cannot process Cmdlet Definition XML for the following file:

$
0
0

Hi everybody,

I have a strange problem with Mount-DiskImage command.

Environment: Windows server 2012 without any updates.

All scripts signed as it was in Hanselman's blogpost

http://www.hanselman.com/blog/SigningPowerShellScripts.aspx

First script(script1) executing on one machine (server1), then copy another script(script2) to the remote server(server2) and run script2 in a PS-Session. Both are signed. Certificates are located on both servers.

In a script I tried to

 Import-Module Storage
 $mountVolume = Mount-DiskImage -ImagePath $ImageSourcePath -PassThru

where ImageSourcePath is a networkpath to iso image.

But getting exception.

Exception Text:

Cannot process Cmdlet Definition XML for the following file:
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Storage\Disk.cdxml. At line:138 char:17
+                 $__cmdletization_objectModelWrapper = Microsoft.PowerShell.Utili ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executable script code found in signature block.
At line:139 char:17
+                 $__cmdletization_objectModelWrapper.Initialize($PSCmdlet, $scrip ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executable script code found in signature block.
At line:143 char:21

When I look into the C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Storage\Disk.cdxml I didn't get what's happend, because in line 138- was xml comment.

Any ideas?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>