Why is the Uninstall-ChocolateyPackage cmdlet not recognized?
<p>I am trying to run a PowerShell script to uninstall <code>owncloud-client</code> from my Windows 10 virtual machine. The code shown below can be found at </p>

<p><a href="https://chocolatey.org/packages/owncloud-client" rel="nofollow">https://chocolatey.org/packages/owncloud-client</a> (tools\chocolateyUninstall.ps1)</p>

<p>I would like just to test the code by running it from PowerShell to see if it actually uninstalls the software.</p>

<pre><code>$unfile = "ownCloud\uninstall.exe"

if (Test-Path "${Env:ProgramFiles(x86)}\$unfile") {
  $unpath = "${Env:ProgramFiles(x86)}\$unfile"
} else {
  $unpath = "${Env:ProgramFiles}\$unfile"
}

Uninstall-ChocolateyPackage 'owncloud-client' 'exe' '/S' "$unpath"
</code></pre>

<p>I run script from the directory that contains it by typying:</p>

<pre><code>.\chocolateyUninstall.ps1
</code></pre>

<p>As output I get the following error: </p>

<pre><code>Uninstall-ChocolateyPackage  is not recognized as the name of cmdlet, function, script file, or operable program.
</code></pre>

<p>The Uninstall-ChocolateyPacakge.ps1 package is provided by chocolatey. I checked on my machine and this package is present under:</p>

<pre><code>C:\ProgramData\chocolatey\helpers\functions\Uninstall-ChocolateyPackage.ps1
</code></pre>

<p>but still it is not recognized as cmdlet by powershell. How can I solve this problem? thanks</p>