Powershell Script Help
Posted on 2013-06-24
Not a powershell script expert need some help.
trying to create the folder path on the export-mailbox command below so that file filename is journal-06212013.pst as an example
$today = Get-Date -Format "MMddyyyy"
$Folder = M:\emai\journal\journal-$today.pst
The term 'M:\emai\journal\journal-$today' is not recognized as the name of a cmdlet, func
tion, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\Util\testdate.ps1:2 char:41
+ $Folder = M:\emai\journal\journal-$today <<<<
+ CategoryInfo : ObjectNotFound: (M:\emai\journal\journal-$today:String) 
+ FullyQualifiedErrorId : CommandNotFoundException
Export-Mailbox –Identity journal -PSTFolderPath $folder -StartDate $((Get-date).AddDays(-7)) –EndDate $(Get-date) -DeleteContent
What am I not doing right here?