title: PowerShell unable to compress and delete source files in my desktop?
body: <p>I need some help in fixing the issue with the PowerShell command to compress and delete the .CSV files from my desktop.</p>
  <p>The error is as follows:</p>
  <pre><code>At line:14 char:5
  +     Compress-Archive @paramCompressArchive
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (Get-ChildItem -...ldersStats.CSV&quot;:String) [Compress-Archive], InvalidOperationException
      + FullyQualifiedErrorId : ArchiveCmdletPathNotFound,Compress-Archive
  </code></pre>
  <p>This is my script so far, which is part of my larger script, but I just need to fix the issue on the moving to ZIP archive and then delete section:</p>
  <pre><code>$MailboxName = 'My.UserName@domain.com'
  try {
      $paramCompressArchive = @{
          Path            = 'Get-ChildItem -Path &quot;$([Environment]::GetFolderPath(&quot;Desktop&quot;))\&quot; 
                                           -Include &quot;$($MailboxName)-RetentionPolicyTags.CSV&quot;, 
                                                    &quot;$($MailboxName)-Details.CSV&quot;, 
                                                    &quot;$($MailboxName)-Diagnostic.CSV&quot;, 
                                                    &quot;$($MailboxName)-MRMLogs.CSV&quot;,
                                                    &quot;$($MailboxName)-MbxStats.CSV&quot;,
                                                    &quot;$($MailboxName)-MbxFoldersStats.CSV&quot;,
                                                    &quot;$($MailboxName)-ArchiveMbxFoldersStats.CSV&quot;'
          DestinationPath = &quot;$([Environment]::GetFolderPath(&quot;Desktop&quot;))\$($MailboxName).ZIP&quot;
          Force           = $true
      }
     
      Compress-Archive @paramCompressArchive
      
      $paramRemoveItem = @{
          Path    = &quot;$([Environment]::GetFolderPath(&quot;Desktop&quot;))\&quot;
          Include = &quot;$($MailboxName)-RetentionPolicyTags.CSV&quot;, 
                      &quot;$($MailboxName)-Details.CSV&quot;, 
                      &quot;$($MailboxName)-Diagnostic.CSV&quot;, 
                      &quot;$($MailboxName)-MRMLogs.CSV&quot;,
                      &quot;$($MailboxName)-MbxStats.CSV&quot;,
                      &quot;$($MailboxName)-MbxFoldersStats.CSV&quot;,
                      &quot;$($MailboxName)-ArchiveMbxFoldersStats.CSV&quot;
          Force   = $true
          WhatIf  = $true
      }
     
      Remove-Item @paramRemoveItem
  }
  catch {
      $error[0].exception.gettype().fullname
  }
  </code></pre>