Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_unzip breaks when using beta Pscx version 4 #563

Open
b-a0 opened this issue May 1, 2024 · 0 comments
Open

win_unzip breaks when using beta Pscx version 4 #563

b-a0 opened this issue May 1, 2024 · 0 comments

Comments

@b-a0
Copy link

b-a0 commented May 1, 2024

SUMMARY

To work around a known issue in Pscx 3.3.2 I tried the proposed workaround and installed the pre-release version: Install-Module pscx -AllowPrerelease -Force. That version renames Expand-Archive to Expand-PscxArchive.

This prevents overriding the built-in Expand-Archive, but the built-in command has a different parameter for the destination.

In the Pscx Expand-Archive this was -OutputPath and in the PowerShell Expand-Archive this is -DestinationPath. The win_unzip module expects the Pscx version and uses OutputPath.

So I can either install Pscx 3.3.2 and override several built in commands, or I can install Pscx 4.0.0 beta but then the win_unzip module breaks.

I understand this is a pre-release version of Pscx, but I thought I would bring it up such that it could be adjusted in time.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_unzip

ANSIBLE VERSION
ansible [core 2.16.6]
  config file = None
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/user/.local/bin/ansible
  python version = 3.11.8 (main, Feb 19 2024, 12:13:24) [GCC 9.4.0] (/usr/local/bin/python3)
  jinja version = 3.1.3
  libyaml = True
COLLECTION VERSION
# /home/user/.local/lib/python3.11/site-packages/ansible_collections
Collection        Version
----------------- -------
community.windows 2.2.0
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

Running under WSL on Windows 10 22H2.
Linux PC-NUMBER 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

STEPS TO REPRODUCE
  1. Start the ansible-console
  2. Install pre-release Pscx: community.windows.win_psmodule name=Pscx state=latest accept_license=true allow_prerelease=true
  3. Try to unzip: community.windows.win_unzip src="L:/Tmp/test.exe" dest="L:/Tmp/output"
community.windows.win_unzip src="L:/Tmp/test.exe" dest="L:/Tmp/output"
EXPECTED RESULTS

The self-extracting archive test.exe is extracted to to output.

ACTUAL RESULTS

I get a failed status with the message:

Msg: A parameter cannot be found that matches parameter name 'OutputPath'."

server | FAILED! => {
    "changed": false,
    "dest": "L:/Tmp/output",
    "msg": "Error expanding 'L:/Tmp/test.exe' to 'L:/Tmp/output'! Msg: A parameter cannot be found that matches parameter name 'OutputPath'.",
    "pscx_status": "present",
    "removed": false,
    "src": "L:/Tmp/test.exe"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant