Remove deprecated Load-CommandUtils and Import-PrivilegeUtil (#77457)

pull/77466/head
Martin Krizek 3 years ago committed by GitHub
parent cdf998fa79
commit dce30e2577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
removed_features:
- Remove deprecated powershell functions ``Load-CommandUtils`` and ``Import-PrivilegeUtil``

@ -3,25 +3,6 @@
#AnsibleRequires -CSharpUtil Ansible.Process
Function Load-CommandUtils {
<#
.SYNOPSIS
No-op, as the C# types are automatically loaded.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Cannot change the name now")]
Param()
$msg = "Load-CommandUtils is deprecated and no longer needed, this cmdlet will be removed in a future version"
if ((Get-Command -Name Add-DeprecationWarning -ErrorAction SilentlyContinue) -and (Get-Variable -Name result -ErrorAction SilentlyContinue)) {
Add-DeprecationWarning -obj $result.Value -message $msg -version 2.12
}
else {
$module = Get-Variable -Name module -ErrorAction SilentlyContinue
if ($null -ne $module -and $module.Value.GetType().FullName -eq "Ansible.Basic.AnsibleModule") {
$module.Value.Deprecate($msg, "2.12")
}
}
}
Function Get-ExecutablePath {
<#
.SYNOPSIS
@ -123,4 +104,4 @@ Function Run-Command {
}
# this line must stay at the bottom to ensure all defined module parts are exported
Export-ModuleMember -Function Get-ExecutablePath, Load-CommandUtils, Run-Command
Export-ModuleMember -Function Get-ExecutablePath, Run-Command

@ -3,25 +3,6 @@
#AnsibleRequires -CSharpUtil Ansible.Privilege
Function Import-PrivilegeUtil {
<#
.SYNOPSIS
No-op, as the C# types are automatically loaded.
#>
[CmdletBinding()]
Param()
$msg = "Import-PrivilegeUtil is deprecated and no longer needed, this cmdlet will be removed in a future version"
if ((Get-Command -Name Add-DeprecationWarning -ErrorAction SilentlyContinue) -and (Get-Variable -Name result -ErrorAction SilentlyContinue)) {
Add-DeprecationWarning -obj $result.Value -message $msg -version 2.12
}
else {
$module = Get-Variable -Name module -ErrorAction SilentlyContinue
if ($null -ne $module -and $module.Value.GetType().FullName -eq "Ansible.Basic.AnsibleModule") {
$module.Value.Deprecate($msg, "2.12")
}
}
}
Function Get-AnsiblePrivilege {
<#
.SYNOPSIS
@ -98,5 +79,5 @@ Function Set-AnsiblePrivilege {
}
}
Export-ModuleMember -Function Import-PrivilegeUtil, Get-AnsiblePrivilege, Set-AnsiblePrivilege
Export-ModuleMember -Function Get-AnsiblePrivilege, Set-AnsiblePrivilege

Loading…
Cancel
Save