Microsoft Virtualization Discussions

RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

sjallabais

Hi!

I want to do this:

$tmpShares = Get-NaCifsShare | Where-Object {$_.MountPoint -like "/vol/MyVol/*"}

$tmpShares | Remove-NaCifsShare

..

..do some magic with the volume, and then..

..

$tmpShares | Add-NaCifsShare

Remove-NaCifsShare works fine, but Add-NaCifsShare wont take this object as input from the pipe.

It works if I do a lot of "Select-Object @{Name="Path";Expression={$_."MountPoint"}}" stuff, but should

it be necessary to do a lot of parameter renaming on these? (I think not).

I know I also need to preserve and restore the ACL's with Get-NaCifsShareAcl, Set-NaCifsShareAcl, but they seems

to be "compatible" (I'll be happy if someone has a more elegant way of doing this procedure:)

/Sjalla

3 REPLIES 3

vinith

Hello,

Add-NaCifsShare accepts values only by property by pipeline, hence you need to convert mountpoint to hashtable property of "path" and pass the values.

Thanks,

Vinith

sjallabais

On second thoughts, the most elegant would be that Get-NaCifsShare and Add-NaCifsShare also (optionally?) could handle the ACL's..

vinith

Hello,

Add-NaCifsShare accepts values only by property by pipeline, hence you need to convert mountpoint to hashtable property of "path" and pass the values.

Thanks,

Vinith

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