| Server IP : 121.121.20.254 / Your IP : 216.73.217.51 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/ProgramData/chocolatey/extensions/chocolatey-compatibility/ |
Upload File : |
# Export functions that start with capital letter, and located in helpers directory.
# Other files are considered private, and should not be imported.
$ScriptRoot = Split-Path $MyInvocation.MyCommand.Definition
# The functions available in Chocolatey is not available in a variable
# we need to skip the import of a function if it already exist, as such
# we need to check the file system directly.
$ChocolateyScriptPath = Resolve-Path "$env:ChocolateyInstall\helpers\functions"
$existingMembers = Get-ChildItem $ChocolateyScriptPath | ForEach-Object BaseName
Get-ChildItem "$ScriptRoot\helpers\*.ps1" | `
Where-Object { $_.Name -cmatch "^[A-Z]+" } | `
ForEach-Object {
$name = $_.BaseName
if ($existingMembers -notcontains $name) {
Write-Debug "Exporting function '$name' for backwards compatibility"
. $_
Export-ModuleMember -Function $name
}
else {
Write-Debug "Function '$name' exists, ignoring export."
}
}