Skip to content

Beta.9 - Install-PowerShellRemoting error while executing. #5307

@MaximoTrinidad

Description

@MaximoTrinidad

Executing Install-PowerShellRemoting.ps1 script gives an error bit seems to complete OK.
So, I think the script still valid and need to be fix.

Steps to reproduce

  1. Open PowerShell Core Beta 9 - pwsh:
  2. Execute following script file :
.\Install-PowerShellRemoting.ps1

Expected behavior

Script to complete with out any errors.


Actual behavior

Shows errors in the begining:

PS C:\Program Files\PowerShell\6.0.0-beta.9> .\Install-PowerShellRemoting.ps1
Get-Content : Cannot find path 'C:\Program Files\PowerShell\6.0.0-beta.9\Powershell.Version' because it does not exist.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:136 char:23
+     $versionString = (Get-Content $targetPsVersionFilePath).Trim()
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program File...ershell.Version:String) [Get-Content], ItemNotFoundEx
   ception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

You cannot call a method on a null-valued expression.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:136 char:5
+     $versionString = (Get-Content $targetPsVersionFilePath).Trim()
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:137 char:8
+     if($versionString.StartsWith("v"))
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:141 char:5
+     $index = $versionString.LastIndexOf(".")
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:142 char:5
+     $version = $versionString.Substring(0,$index)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:143 char:5
+     $revision = $versionString.Substring($index).split("-")
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Cannot index into a null array.
At C:\Program Files\PowerShell\6.0.0-beta.9\Install-PowerShellRemoting.ps1:144 char:5
+     $version= $version + $revision[0]
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

VERBOSE: Using PowerShell Version:
VERBOSE: Performing the operation "Copy File" on target "Item: C:\Program Files\PowerShell\6.0.0-beta.9\pwrshplugin.dll
 Destination: C:\WINDOWS\System32\PowerShell\pwrshplugin.dll".

Environment data

Windows 10 Insider Edition Build 17025

PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-beta.9
PSEdition                      Core
GitCommitId                    v6.0.0-beta.9
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

psremotingscript_2017-11-02_9-32-57

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.WG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions