The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Powershell Read-ncfile cant find file

drydholm

Hi 

I was hoping someone could help me.

I'm trying to run the powershell command Read-ncfile and get the command-history.log but the command fails with can't find file.

For exampel i run the following which fails

Read-NcFile -Path /vol/vol0/etc/log/mlog/command-history.log -VserverContext Cluster1-Node1

 

But the following command does not fail

Read-NcFile -Path /vol/vol0/etc/log/mlog/vifmgr.log -VserverContext Cluster1-Node1

 

from what I'v tried it only fails when there is a "-" character in the name of the file.  I'v tried adding a escape character like / or ` but it does not make any difference.

Anyone got any ideas? 

1 ACCEPTED SOLUTION

JohnChampion

I did a Get-NcFile for the two files.  The command-history.log is a symbolic link while the vifmgr.log is an actual file.  Looks like Read-NcFile only works for the actual file paths and doesn't support symbolic links. 

readncfile.jpg

A workaround might be to go through the SPI interface (https://{clusterip}/spi) using Invoke-WebRequest or Invoke-RestMethod. 

View solution in original post

2 REPLIES 2

JohnChampion

I did a Get-NcFile for the two files.  The command-history.log is a symbolic link while the vifmgr.log is an actual file.  Looks like Read-NcFile only works for the actual file paths and doesn't support symbolic links. 

readncfile.jpg

A workaround might be to go through the SPI interface (https://{clusterip}/spi) using Invoke-WebRequest or Invoke-RestMethod. 

View solution in original post

drydholm

Hi JohnChampion,

 

I did a invoke-WebRequest and it worked great. Thanks for the help.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public