Subscribe

RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

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 procedureSmiley Happy

/Sjalla

Re: RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

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

Re: RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

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

Re: RFE: Get-NaCifsShare Add-NaCifsShare parameter passing

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