Out-File: output file path is not accepted
<p>Still learning and am having a hard time trying to output information to a file: the <strong>output file path is not accepted</strong>.  </p>

<p>My <strong>location is <code>PS Cert:\localmachine</code></strong> and here is the entire command:</p>

<pre><code>$cert = Get-ChildItem -Path cert: -Recurse | where { $_.notafter -le (get-date).AddDays(75) -AND $_.notafter -gt (get-date)} | select notafter, issuer, thumbprint, subject | sort-object notafter
$cert | Out-File -FilePath \\ad.dcpds.cpms.osd.mil\WinAdm\Logs\Expiring_Certificates\$hostname.log
</code></pre>

<p>The <strong>error message</strong> I'm getting is:</p>

<p><code>Out-File : Cannot open file because the current provider (Microsoft.PowerShell.Security\Certificate) cannot open a file.</code></p>