Microsoft Virtualization Discussions

Get-NcCifsSessionFile : There is an error in XML document

JRN1
1,869 Views

Hi,

 

if I write the output from Get-NcCifsSessionFile in variable I got often the XML error message.

 

Any suggestion to solve the error?

DataOntap 9.8.0

 

$OpenFilesNC = Get-NcCifsSessionFile  -VserverContext  $srv  | Select Vserver,Share,ShareMode,OpenMode,Path,FileId

 

Error:
Get-NcCifsSessionFile : There is an error in XML document (1, 6000).
At
+ ... $OpenFilesNC = Get-NcCifsSessionFile -VserverContext $srv |Select ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (.............. :NcController) [Get-NcCifsSessionFile], InvalidOperationException
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Cifs.GetNcCifsSessionFile

1 ACCEPTED SOLUTION

hmoubara
1,737 Views

Hello

I was able to get your variable to work as is, but i have to use command: Invoke-expression to get it to work.

Per example:

Get-variable -Name test:

Get-NcCifsSessionFile -VserverContext svm1_cluster1 | Select vserver,share,sharemode,openmode,path,fileid

PS> Invoke-expression $test

 

View solution in original post

4 REPLIES 4

hmoubara
1,748 Views

Hello @JRN1 

 

Can you confirm if you are able to run the command outside of the variable without any issue?

 

Thanks

JRN1
1,740 Views

Hello @hmoubara ,

 

yes I can confirm.

 

I found a way today. If I run it for specific share it works without error.

 

Have to use "-Query" because no "-Share" is available.

 

$OpenFilesNC = Get-NcCifsSessionFile -Query @{ Share = $ShareName} |Select Vserver,Share,ShareMode,OpenMode,Path,FileId

 

Thanks

hmoubara
1,738 Views

Hello

I was able to get your variable to work as is, but i have to use command: Invoke-expression to get it to work.

Per example:

Get-variable -Name test:

Get-NcCifsSessionFile -VserverContext svm1_cluster1 | Select vserver,share,sharemode,openmode,path,fileid

PS> Invoke-expression $test

 

JRN1
1,729 Views

Hi thanks for finding that out. 

Both solutions looks  to work.

Public