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

New-ModuleManifest will not accept space characters in Uris #3336

Copy link
Copy link
@daleecc

Description

@daleecc
Issue body actions

Steps to reproduce

$uri = ([System.Uri]"http://tfs:8080/tfs/ISD/Automation/_versionControl?path=%24%2FAutomation%20Test")

New-ModuleManifest `
    -Path "./Test.psd1" `
    -ModuleVersion "2.0.0.0" `
    -ProjectUri $uri

Expected behavior

Manifest is created with a ProjectUri value of:

http://tfs:8080/tfs/ISD/Automation/_versionControl?path=%24%2FAutomation%20Test

Actual behavior

The following error is thrown as the uri appears to have been decoded prior to validation:

New-ModuleManifest : The specified value 'http://tfs:8080/tfs/ISD/Automation/_versionControl?path=$/Automation Test' is invalid, try again with a valid value.
At C:\Work\TFS\Automation\Deployment Automation\Development\PipelineImprovements\ServerIntegrationManagement\Modules\ServerIntegrationManagementClientCore\Test.ps1:5 char:1
+ New-ModuleManifest `
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (ProjectUri:String) [New-ModuleManifest], InvalidOperationException
    + FullyQualifiedErrorId : Modules_InvalidUri,Microsoft.PowerShell.Commands.NewModuleManifestCommand

Testing has found that it is %20 (space character) which is causing the issue. The uri validates with [System.Uri]::IsWellFormedUriString with a return value of $true

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues

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.