Effective December 3, NetApp adopts Microsoft’s Business-to-Customer (B2C) identity management to simplify and provide secure access to NetApp resources.
For accounts that did not pre-register (prior to Dec 3), access to your NetApp data may take up to 1 hour as your legacy NSS ID is synchronized to the new B2C identity.
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

How to add $ at the end of the user provided information.

koushi

How to add $ at the end of the user provided information.
My Qtree should be add with _q at the end once user provided qtree as test then it should be tree_q
My sharename should be add with $ at the end once user provided qtree as test then it should be tree$

 

For more information

 

$qtreename = Read-Host -Prompt 'Input your QTREE  name'

 

New-NcQtree -Volume $volumename -Qtree $qtreename -SecurityStyle ntfs -Vserver $vservername  # here Qtree name need to be append as '_q' at the end of qtree name

 

Add-NcCifsShare -Name $share -Path $pathname1 -SymlinkProperties hide -OfflineFilesMode Manual -VscanProfile strict -Vserver $vservername #  Here sharename should follows with Qtreename$ as powershell takes $ as input of the variable im facing few challenges

 

can anyone please help

1 ACCEPTED SOLUTION

Aparajita

Escaping the $ with "`" should do the trick ...

 

$qtreename = Read-Host -Prompt 'Input your QTREE  name'
$qtreename = $qtreename + "_q" #Append _q to the qtree name that was input

New-NcQtree -Volume $volumename -Qtree $qtreename -SecurityStyle ntfs -Vserver $vservername

$share = "`$$qtreename" #` is the escape character in PowerShell
Add-NcCifsShare -Name $share -Path $pathname1 -SymlinkProperties hide -OfflineFilesMode Manual -VscanProfile strict -Vserver $vservername

Hope this helps,

Aparajita

View solution in original post

3 REPLIES 3

koushi

Hey JGPSHNTAP,

 

The one which im looking for is been answered by Aparajita.

As powershell never allow $ at the end we can user '$ at the end will works..

 

I tried the same and it worked.

 

Thanks to both of you.

 

 

 

Aparajita

Escaping the $ with "`" should do the trick ...

 

$qtreename = Read-Host -Prompt 'Input your QTREE  name'
$qtreename = $qtreename + "_q" #Append _q to the qtree name that was input

New-NcQtree -Volume $volumename -Qtree $qtreename -SecurityStyle ntfs -Vserver $vservername

$share = "`$$qtreename" #` is the escape character in PowerShell
Add-NcCifsShare -Name $share -Path $pathname1 -SymlinkProperties hide -OfflineFilesMode Manual -VscanProfile strict -Vserver $vservername

Hope this helps,

Aparajita

View solution in original post

JGPSHNTAP

^^

Unless i'm reading this wrong, I don't think that's what he's asking for..

 

You want to know how to add $ to the end of a share before you create it so it's hidden, right?

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