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

[Shell] Issue encountered in Windows PowerShell on Windows #2112

Open
A-kirami opened this issue Nov 30, 2024 · 3 comments
Open

[Shell] Issue encountered in Windows PowerShell on Windows #2112

A-kirami opened this issue Nov 30, 2024 · 3 comments
Labels
help wanted Extra attention is needed platform: windows Windows specific issues plugin: shell question Further information is requested

Comments

@A-kirami
Copy link

A-kirami commented Nov 30, 2024

Hello, I am using a shell plugin to run commands, but I am currently facing a troublesome issue.

await Command.create('exec-sh', `powershell -ExecutionPolicy ByPass -c "irm ${url} | iex"`).execute()

The code above results in the following error upon execution:

The 'Get-ExecutionPolicy' command was found in the module 'Microsoft.PowerShell.Security', but the module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'.

How should I resolve this?

I apologize for the interruption, but I have not been able to resolve this issue despite my attempts to search for a solution.

Thank you for your attention, and I hope to receive guidance on this matter.

Additional Information

Permissions Configuration:

"permissions": [
  {
    "identifier": "shell:allow-execute",
    "allow": [
      {
        "name": "exec-sh",
        "cmd": "powershell",
        "args": true
      }
    ]
  }
]

Tauri Info

[✔] Environment
    - OS: Windows 10.0.22631 x86_64 (X64)
    ✔ WebView2: 131.0.2903.70
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.85.0-nightly (6b6a867ae 2024-11-27)
    ✔ cargo: 1.85.0-nightly (4c39aaff6 2024-11-25)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 22.11.0
    - npm: 10.9.0
    - bun: 1.1.36
    - deno: deno 2.0.6

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.2
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.2
    - @tauri-apps/plugin-shell : 2.0.1
    - tauri-plugin-fs 🦀: 2.0.3
    - @tauri-apps/plugin-fs : 2.0.2
    - tauri-plugin-dialog 🦀: 2.0.3
    - @tauri-apps/plugin-dialog : 2.0.1
    - tauri-plugin-log 🦀: 2.0.2
    - @tauri-apps/plugin-log : 2.0.0
    - tauri-plugin-updater 🦀: 2.0.2
    - @tauri-apps/plugin-updater : 2.0.0
    - tauri-plugin-process 🦀: 2.0.1
    - @tauri-apps/plugin-process : 2.0.0
    - tauri-plugin-os 🦀: 2.0.1
    - @tauri-apps/plugin-os : 2.0.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: Vue.js
    - bundler: Vite
@Legend-Master Legend-Master added question Further information is requested plugin: shell platform: windows Windows specific issues labels Nov 30, 2024
@FabianLars
Copy link
Member

could you share the output of $PSVersionTable please. this sounds like an issue with powershell itself tbh (and a quick google search suggests the same).

@A-kirami
Copy link
Author

A-kirami commented Dec 1, 2024

could you share the output of $PSVersionTable please. this sounds like an issue with powershell itself tbh (and a quick google search suggests the same).

Alright, the output of $PSVersionTable is as follows.

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

@FabianLars FabianLars added the help wanted Extra attention is needed label Dec 2, 2024
@FabianLars
Copy link
Member

hmm that looks alright. I also tested it myself just now and i don't see that error so i assume there's some system config issue here but i can't really find anything helpful on the internet 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed platform: windows Windows specific issues plugin: shell question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants