Make generated implicit remoting modules backwards compatible with PowerShell 5 (#17227)

* Fix implicit remoting generator version check

* Fix implicit remoting generator version check
This commit is contained in:
Tadas Medišauskas
2022-08-08 10:18:51 -07:00
committed by GitHub
parent 65b83e90d5
commit 53a212ee65
@@ -2100,7 +2100,9 @@ $script:MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
// In Win8, we are no longer loading all assemblies by default.
// So we need to use the fully qualified name when accessing a type in that assembly
string versionOfScriptGenerator = "[" + typeof(ExportPSSessionCommand).AssemblyQualifiedName + "]" + "::VersionOfScriptGenerator";
Type type = typeof(ExportPSSessionCommand);
string asmName = type.Assembly.GetName().Name;
string versionOfScriptGenerator = $"[{type.FullName}, {asmName}]::VersionOfScriptGenerator";
GenerateTopComment(writer);
writer.Write(
HeaderTemplate,