Recently, while working on a Public Folder migration from Exchange 2007 to 2013, I ran into the following error.
C:\Program Files\Microsoft\Exchange Server\Scripts>.\Export-PublicFolderStatistics.ps1 "C:\PFMigration\PublicFolderStats.csv" Ex2007.domain.local
Parameter declarations are a comma-separated list of variable names with optional initializer expressions.
At C:\Program Files\Microsoft\Exchange Server\Scripts\Export-PublicFolderStatistics.ps1:16 char:168
+ HelpMessage = "Full path of the output file to be generated. If only filename is specified, then the output file will be generated in the current directory.")] <<<<
It had me scratching my head for a couple of minutes. Then I quickly realized what I had forgotten. I needed PowerShell 2.0 to run this script.
If you are having this same error then make sure you download the Windows Management Framework Core pack from Microsoft. The pack includes PowerShell 2.0 and WinRM 2.0.
You can find it here.
The install won’t require a reboot. Once installed rerun your script.
With the rapid whirlwind of technological advancements its easy to forget the nuances of older operating systems.