<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PowerCLI how to check/delete/zero a file size in /tmp ? in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514748#M17021</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no PowerCLI cmdlet to do that.&lt;BR /&gt;But you can use SSH (via the &lt;A href="http://www.lucd.info/knowledge-base/use-posh-ssh-instead-of-putty/"&gt;Posh-SSH module&lt;/A&gt; for example) to run commands in ESXi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jan 2020 20:53:27 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2020-01-29T20:53:27Z</dc:date>
    <item>
      <title>PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514747#M17020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My ESXi 6.5 hosts /tmp folder is full with the HPE file "ams-bbUsg.txt" using all the space. Is there a way to use powercli to delete or zero the file if present?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 20:48:59 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514747#M17020</guid>
      <dc:creator>PaulB2</dc:creator>
      <dc:date>2020-01-29T20:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514748#M17021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no PowerCLI cmdlet to do that.&lt;BR /&gt;But you can use SSH (via the &lt;A href="http://www.lucd.info/knowledge-base/use-posh-ssh-instead-of-putty/"&gt;Posh-SSH module&lt;/A&gt; for example) to run commands in ESXi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 20:53:27 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514748#M17021</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2020-01-29T20:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514749#M17022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Funny, I was actually also looking for this exact same thing, which is how I found this. &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To follow through with LucD's comment, I made a very slight modification to his script from the one he provided in another thread here -&amp;gt; #&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2530" data-containertype="14" data-objectid="605539" data-objecttype="1" href="https://communities.vmware.com/thread/605539"&gt;https://communities.vmware.com/thread/605539&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tested it on 2 hosts last night and it worked. &lt;/P&gt;&lt;P&gt;You'd have to install the Posh-SSH module first (Find-Module Posh-SSH | Install-Module), and all the root passwords must be the same if you're running it against multiple ESXi hosts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always, thanks LucD. I'm sure you know how many thousands of people's careers you've saved &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;============================Individual ESXi host============================&lt;/P&gt;&lt;P&gt;$esxName = 'esxi_host_name'&lt;/P&gt;&lt;P&gt;$cred = Get-Credential -Message 'Enter credentials'&lt;/P&gt;&lt;P&gt;$cmdsub = @'&lt;/P&gt;&lt;P&gt;&amp;gt; /tmp/ams-bbUsg.txt&lt;/P&gt;&lt;P&gt;'@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$esx = Get-VMHost -Name $esxName&lt;/P&gt;&lt;P&gt;$session = New-SSHSession -ComputerName $esx.Name -Credential $cred –AcceptKey&lt;/P&gt;&lt;P&gt;$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub&lt;/P&gt;&lt;P&gt;Remove-SSHSession -SSHSession $session | Out-Null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;============================Multiple ESXi hosts============================&lt;/P&gt;&lt;P&gt;$esxName = Get-Content -Path "C:\Path\to\textfilewithhostnames.txt"&lt;/P&gt;&lt;P&gt;$cred = Get-Credential -Message 'Enter credentials'&lt;/P&gt;&lt;P&gt;foreach($esxNames in $esxName)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$cmdsub = @'&lt;/P&gt;&lt;P&gt;&amp;gt; /tmp/ams-bbUsg.txt&lt;/P&gt;&lt;P&gt;'@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$esx = Get-VMHost -Name $esxNames&lt;/P&gt;&lt;P&gt;$session = New-SSHSession -ComputerName $esx.Name -Credential $cred –AcceptKey&lt;/P&gt;&lt;P&gt;$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub&lt;/P&gt;&lt;P&gt;Remove-SSHSession -SSHSession $session | Out-Null&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2020 20:34:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514749#M17022</guid>
      <dc:creator>BBB36</dc:creator>
      <dc:date>2020-03-06T20:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514750#M17023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi BBB36,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use your script but for some reason the TMP was not getting deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've run your script and check on the Putty the TMP is still 100%.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2020 23:54:46 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514750#M17023</guid>
      <dc:creator>fourpixels</dc:creator>
      <dc:date>2020-04-21T23:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514751#M17024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;BBB36&lt;/B&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It just creating another same file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://communities.vmware.com/t5/image/serverpage/image-id/19323i9098C86AC53AF506/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2020 04:33:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514751#M17024</guid>
      <dc:creator>fourpixels</dc:creator>
      <dc:date>2020-04-22T04:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514752#M17025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you set UTF-8 as the default output in PowerShell?&lt;/P&gt;&lt;P&gt;That question mark at the end of the filename seems to indicate that.&lt;/P&gt;&lt;P&gt;Or have you used that question mark as a wild card character in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2020 10:31:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514752#M17025</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2020-04-22T10:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514753#M17026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;B&gt;LucD&lt;/B&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi thanks for response. I didn't modifying anything on the script I just copy it as is and run it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So tried this version below and use the rm -rf command and it deletes the duplicate file with "?" but if I run it again original TMP still there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$esxName = 'hostname'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$cred = Get-Credential -Message 'Enter credentials'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$cmdsub = @'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rm -rf /tmp/ams-bbUsg.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'@&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$esx = Get-VMHost -Name $esxName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$session = New-SSHSession -ComputerName $esx.Name -Credential $cred –AcceptKey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$result = Invoke-SSHCommand -SSHSession $session -Command $cmdSub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remove-SSHSession -SSHSession $session | Out-Null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apologies, still learning the PowerShell hope you can help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2020 06:51:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514753#M17026</guid>
      <dc:creator>fourpixels</dc:creator>
      <dc:date>2020-04-23T06:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514754#M17027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Was able to resolve it by using this one below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$cmdsub = "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; /tmp/ams-bbUsg.txt | out-string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2020 07:53:21 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514754#M17027</guid>
      <dc:creator>fourpixels</dc:creator>
      <dc:date>2020-04-23T07:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI how to check/delete/zero a file size in /tmp ?</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514755#M17028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as the HPE Agentless Management Service (AMS) version 11.4.0 is still installed, yes the file will get re-created (or the data will re-populate if you'd chosen to empty it instead).&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You'd have to upgrade AMS version 11.4.5 for the issue to be permanently fixed. See &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US&amp;amp;docId=emr_na-a00076197en_us" rel="nofollow"&gt;https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US&amp;amp;docId=emr_na-a00076197en_us&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2020 12:39:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-how-to-check-delete-zero-a-file-size-in-tmp/m-p/514755#M17028</guid>
      <dc:creator>BBB36</dc:creator>
      <dc:date>2020-04-30T12:39:38Z</dc:date>
    </item>
  </channel>
</rss>

