Stop referencing Microsoft.PowerShell.Security when the core snapin is used (#17771)

This commit is contained in:
Dongbo Wang
2022-08-01 10:10:59 -07:00
committed by GitHub
parent f2204a08b8
commit 2051c5f72b
4 changed files with 20 additions and 25 deletions
@@ -1,14 +1,14 @@
@{
GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" , "Protect-CmsMessage", "Unprotect-CmsMessage", "Get-CmsMessage"
CmdletsToExport = "Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" , "Protect-CmsMessage", "Unprotect-CmsMessage", "Get-CmsMessage"
AliasesToExport = @()
NestedModules="Microsoft.PowerShell.Security.dll"
NestedModules = "Microsoft.PowerShell.Security.dll"
HelpInfoURI = 'https://aka.ms/powershell73-help'
}
@@ -1,15 +1,18 @@
@{
GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertificate", "Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "Get-AuthenticodeSignature", "Set-AuthenticodeSignature", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-CmsMessage", "Unprotect-CmsMessage", "Protect-CmsMessage" , "New-FileCatalog" , "Test-FileCatalog"
CmdletsToExport = "Get-Acl", "Set-Acl", "Get-PfxCertificate", "Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "Get-AuthenticodeSignature", "Set-AuthenticodeSignature", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-CmsMessage", "Unprotect-CmsMessage", "Protect-CmsMessage" , "New-FileCatalog" , "Test-FileCatalog"
AliasesToExport = @()
NestedModules="Microsoft.PowerShell.Security.dll"
TypesToProcess="Security.types.ps1xml"
NestedModules = "Microsoft.PowerShell.Security.dll"
# 'Security.types.ps1xml' refers to types from 'Microsoft.PowerShell.Security.dll' and thus requiring to load the assembly before processing the type file.
# We declare 'Microsoft.PowerShell.Security.dll' in 'RequiredAssemblies' so as to make sure it's loaded before the type file processing.
RequiredAssemblies = "Microsoft.PowerShell.Security.dll"
TypesToProcess = "Security.types.ps1xml"
HelpInfoURI = 'https://aka.ms/powershell73-help'
}
@@ -3851,13 +3851,6 @@ namespace System.Management.Automation.Runspaces
assemblyEntry.SetPSSnapIn(psSnapInInfo);
Assemblies.Add(assemblyEntry);
// entry from types.ps1xml references a type (Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase) in this assembly
if (psSnapInInfo.Name.Equals(CoreSnapin, StringComparison.OrdinalIgnoreCase))
{
assemblyEntry = new SessionStateAssemblyEntry("Microsoft.PowerShell.Security", null);
this.Assemblies.Add(assemblyEntry);
}
if (cmdlets != null)
{
foreach (SessionStateCmdletEntry cmdlet in cmdlets.Values)
-1
View File
@@ -7,7 +7,6 @@ Describe "Validate start of console host" -Tag CI {
'Microsoft.ApplicationInsights.dll'
'Microsoft.Management.Infrastructure.dll'
'Microsoft.PowerShell.ConsoleHost.dll'
'Microsoft.PowerShell.Security.dll'
'Microsoft.Win32.Primitives.dll'
'Microsoft.Win32.Registry.dll'
'netstandard.dll'