Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@MaximoTrinidad

Description

@MaximoTrinidad
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.