Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace versionTable["GitCommitId"] with PSVersionInfo.GitCommitId
  • Loading branch information
iSazonov committed Sep 27, 2017
commit c3bc0b834f82e8242053634b360416a0c9b636bd
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Register-PSSessionConfiguration
$pluginWsmanRunAsUserPath = [System.IO.Path]::Combine(""WSMan:\localhost\Plugin"", ""$pluginName"", ""RunAsUser"")
set-item -WarningAction SilentlyContinue $pluginWsmanRunAsUserPath $runAsCredential -confirm:$false
}} catch {{

remove-item (Join-Path WSMan:\localhost\Plugin ""$pluginName"") -recurse -force
write-error $_
# Do not add anymore clean up code after Write-Error, because if EA=Stop is set by user
Expand Down Expand Up @@ -1564,7 +1564,7 @@ internal static string GetWinrmPluginShellName()
Hashtable versionTable = PSVersionInfo.GetPSVersionTable();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems versionTable is not used anymore. This line can be removed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

I see TODO comment - currently we can detect that we use 'Release Tag' and automate the name selection. Make sense?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand the intention of this comment. Maybe we should open an issue to track it (fix or remove).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

// TODO: This should be PSVersionInfo.PSVersionName once we get
// closer to release. Right now it doesn't support alpha versions.
return System.String.Concat("PowerShell.", (string)versionTable["GitCommitId"]);
return System.String.Concat("PowerShell.", PSVersionInfo.GitCommitId);
}

/// <summary>
Expand All @@ -1577,7 +1577,7 @@ internal static string GetWinrmPluginDllPath()
Hashtable versionTable = PSVersionInfo.GetPSVersionTable();
// TODO: This should be PSVersionInfo.PSVersionName once we get
// closer to release. Right now it doesn't support alpha versions.
string pluginDllDirectory = System.IO.Path.Combine("%windir%\\system32\\PowerShell", (string)versionTable["GitCommitId"]);
string pluginDllDirectory = System.IO.Path.Combine("%windir%\\system32\\PowerShell", PSVersionInfo.GitCommitId);
return System.IO.Path.Combine(pluginDllDirectory, RemotingConstants.PSPluginDLLName);
}

Expand Down Expand Up @@ -2555,7 +2555,7 @@ function Unregister-PSSessionConfiguration
return
}}
}}

$shellsFound++

$shouldProcessTargetString = $targetTemplate -f $_.Name
Expand Down Expand Up @@ -2779,12 +2779,12 @@ function ExtractPluginProperties([string]$pluginDir, $objectToWriteTo)
}}

Get-Details $pluginDir $h

# Workflow is not supported in PowerShell Core. Attempting to load the
# assembly results in a FileNotFoundException.
if (![System.Management.Automation.Platform]::IsCoreCLR -AND
$h[""AssemblyName""] -eq ""Microsoft.PowerShell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"") {{

$serviceCore = [Reflection.Assembly]::Load(""Microsoft.Powershell.Workflow.ServiceCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"")

if ($null -ne $serviceCore) {{
Expand Down Expand Up @@ -4967,7 +4967,7 @@ function Enable-PSRemoting
}}
}}
}}

# remove the 'network deny all' tag
Get-PSSessionConfiguration -Force:$Force | ForEach-Object {{
$sddl = $null
Expand Down