Search code examples
powershellexchange-server-2010

Format-List not recognized


I'm trying to create a script to automatically export Outlook contacts based on display name. When I run the .bat in Exchange PowerShell, it tells me that Format-List is an unrecognized command. Not quite sure what's going on here. What I've found online usually just recommends running it from PowerShell.


Solution

  • .bat is an extension for batch files, which are run in CMD, even if you call them from PowerShell. CMD and batch files don't know anything about PowerShell cmdlets. If you want to write a PowerShell script, it must have the extension .ps1.