Added check for Chocolatey licensed version

This commit is contained in:
dfrancis-adm
2019-05-31 09:40:16 -04:00
parent 6a00ffa828
commit 0320ba90d8

View File

@@ -24,6 +24,10 @@ function Invoke-ChocoInternalizePackage {
[switch]$PurgeWorkingDirectory
)
begin {
if (-not (Test-Path -Path $env:ChocolateyInstall\license\chocolatey.license.xml)){
Throw 'Chocolatey license not found. Internalizing is only supported in licensed versions.'
return
}
if ($PurgeWorkingDirectory){
Get-ChildItem -Path $Path -Recurse | Remove-Item -Recurse -Force
}