Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! See The Solution
1 ACCEPTED SOLUTION
drydholm has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
A workaround might be to go through the SPI interface (https://{clusterip}/spi) using Invoke-WebRequest or Invoke-RestMethod.
2 REPLIES 2
drydholm has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
A workaround might be to go through the SPI interface (https://{clusterip}/spi) using Invoke-WebRequest or Invoke-RestMethod.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JohnChampion,
I did a invoke-WebRequest and it worked great. Thanks for the help.
