Skip to content

Save-PSResource with -WhatIf gives unexpected terminating error #1788

Closed
@Gijsreyn

Description

@Gijsreyn

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Whenever adding the -WhatIf switch when saving a PowerShell module, the module doesn't give the what if response correctly. Instead, it terminates.

Steps to reproduce:

Run: Save-PSResource -Name WSManDsc -Path C:\temp -WhatIf

Expected behavior

Provide details about what if

Actual behavior

Gives both what if results and terminates.

Error details

Save-PSResource: Package(s) 'WSManDsc' could not be installed from repository 'PSGallery'.

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.0      preview2   Microsoft.PowerShell.PSResourceGet  {Compress-PSResource, Find-PSResource, Get-Instal…


Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions