title: PowerShell Script Error assistance
body: <p>I am trying to run the following PowerShell Script. It should connect all pst files in Microsoft Outlook from mentioned directory:</p>
  
  <pre><code>Add-Type -Assembly "Microsoft.Office.Interop.Outlook" | Out-Null
  $Outlook = New-Object -ComObject Outlook.Application
  $Namespace = $outlook.GetNameSpace("MAPI")
  Dir "C:\Users\bob\Documents\Outlook Files\* .pst" | % {$Namespace.AddStore($ _. FullName)}
  </code></pre>
  
  <p>I am getting the following error message:</p>
  
  <p><a href="https://i.stack.imgur.com/LuDYw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LuDYw.png" alt="screenshot of error message"></a></p>
  
  <p>Thank you everyone in advance for your contributions.</p>
  
  <p>P.S. Error message in text below. I didn't include it originally because I thought it was sloppy and hard to read.</p>
  
  <pre>
  At line:4 char:80
  + Dir 'C:\Users\bob\Documents\Outlook Files\* .pst' | % {$Namespace.AddStore($ ...
  +                                                                                ~
  Missing ')' in method call.
  At line:4 char:80
  + Dir 'C:\Users\bob\Documents\Outlook Files\* .pst' | % {$Namespace.AddStore($ ...
  +                                                                                ~
  Unexpected token '$' in expression or statement.
  At line:4 char:59
  + Dir 'C:\Users\bob\Documents\Outlook Files\* .pst' | % {$Namespace.AddStore($ ...
  +                                                           ~
  Missing closing '}' in statement block.
  At line:4 char:93
  + ... e($ _. FullName)}
  +                    ~
  Unexpected token ')' in expression or statement.
  At line:4 char:94
  + ... ($ _. FullName)}
  +                    ~
  Unexpected token '}' in expression or statement.
  At line:4 char:80
  + Dir 'C:\Users\bob\Documents\Outlook Files\* .pst' | % {$Namespace.AddStore($ ...
  +                                                                                ~
      + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
      + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall
  </pre>