NetApp SnapManager for Exchange Reports and Powershell Brackets

#NetApp #Powershell

SME is a great tool, but it has an undocumented feature, where it doesn’t flush it’s report files.  Now these files get big and I wanted a way to zip or delete the files.

The issue is that the folder name has brackets in it [servername] and powershell treats brackets as “special”.
Try it! Open powershell, create a folder and put a file in the folder

md C:\ps\[test]

now dir it:

dir C:\ps\[test]

Nothing right, but it works with the command prompt.  It took figging ages and a fair amount of Bing time to work a way around it, it’s dead simple:

dir -LiteralPath C:\ps\[test]

Yeah baby! using -LiteralPath does the trick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.