Only minimal PowerShell support

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
theuserbl
Level 2
Level 2
Posts: 16
Joined: Sat Sep 21, 2013 6:49 pm

Only minimal PowerShell support

Post by theuserbl »

I have tested out the Windows-Version of PowerShell time to time on WINE on Linux. But there are bugs and it seems, that no one interests in it.

I have now with the latest test tested PowerShell 7.3.0-preview.8 on wine-7.3-repack-1 on Ubuntu 22.10.
https://github.com/PowerShell/PowerShell/releases

PowerShell exists also native for Linux. But it make also sense, to run the Windows-Version on WINE.
On Windows the PowerShell replaced cmd.exe. And so it is the new command line interface.

The 64bit PowerShell don't run. It gives out the error

Code: Select all

0100:err:virtual:virtual_setup_exception stack overflow 1808 bytes in thread 0100 addr 0x170054794 stack 0x208f0 (0x20000-0x21000-0x1a0000)
But interestingly the 32bit PowerSell runs.
It gives out some error messages, but it works.

If I run it with wineconsole, there existing the problem, that wineconsole can't handle ANSI escape codes. And so there is no nice coloring but a lot of printed esape codes.

But in the GNOME Terminal with wine started, it works better.

Commands like

Code: Select all

Get-ChildItem

Code: Select all

Get-Process

Code: Select all

Get-ChildItem *.exe | select Name
all works.
But if I input it, the typed input text, jumps to the beginning of the line or the next line and so on. Input a command is very problematical.
But if the command or script is input, then the command or script runs perfect.

Also small scripts, which makes use of the Windows Forms, are working. Like open a MessageBox:

Code: Select all

Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show('Hello World')
Or a little program, with CheckBoxes and a Button, where the CheckBoxes are all selectd, if the Button is pressed.

Code: Select all

Add-Type -AssemblyName System.Windows.Forms

$form = [System.Windows.Forms.Form]::new()

for($i = 10; $i -lt 100; $i += 20) {
    $chkbox = [System.Windows.Forms.CheckBox]@{
        Location = [System.Drawing.Point]::new($i, 10)
        Size     = [System.Drawing.Size]::new(20, 20)
    }
    $form.Controls.Add($chkbox)
}
$btn = [System.Windows.Forms.Button]@{
    Location = [System.Drawing.Point]::new(80, 80)
    Text     = 'Select All'
}
$btn.Add_Click({
    foreach($control in $form.Controls) {
        if($control -is [System.Windows.Forms.CheckBox]) {
            $control.Checked = $true
        }
    }
})
$form.Controls.Add($btn)
[System.Windows.Forms.Application]::EnableVisualStyles()
$form.ShowDialog()
But on the other side the inegrated graphical programs of the Windows Version of the PowerShell don't work.
The Out-GridView creates and error.

Code: Select all

Get-ChildItem | Out-GridView
or

Code: Select all

Get-Process | Out-GridView
don't work.

Same with the graphical help:

Code: Select all

Show-Command
don't wok.

So I would be happy, if the 64bit PowerShell of WINE works. And there isn't a problem to type a input there. Also I would be happy if the Out-GridView and Show-Command works.

I am the only one, who uses the PowerShell on WINE?

With the WSL Microsoft uses also the native Linux bash on Windows, because it have some advantages and it makes sense.
I think it is similar with the native Windows PowerSehell on Linux.
theuserbl
Level 2
Level 2
Posts: 16
Joined: Sat Sep 21, 2013 6:49 pm

Re: Only minimal PowerShell support of WINE

Post by theuserbl »

I types on "edit post" to change the topic of "Only minimal PowerShell support" to "Only minimal PowerShell support by WINE", but a new command is created. :-(
theuserbl
Level 2
Level 2
Posts: 16
Joined: Sat Sep 21, 2013 6:49 pm

Re: Only minimal PowerShell support

Post by theuserbl »

Oh, and I forgot to sy, that the PowerShell, wich runs with WINE, don't recognize if the size of the GNOME Terminal windows changed.
If it is thin and I start with WINE the PowerShell and makes the Terminal windows after that expands in the width, the PowerShell don't recognize it and writes only in a small area.
qwertymnb
Level 4
Level 4
Posts: 236
Joined: Sun Jan 17, 2016 4:36 pm

Re: Only minimal PowerShell support

Post by qwertymnb »

Hi,

Powershell (Core) suffers from a few bugs in wine: see bugzilla (bug 52396 and 49780 mainly)

Luckily there are easy workarounds:
But if I input it, the typed input text, jumps to the beginning of the line or the next line and so on.
That's bug 49789; Try a terminal emulator like ConEmu
The 64bit PowerShell don't run. It gives out the error
That's bug 52396; Either use Staging, that has a fix, or revert to earlier powershell versions before 7.2.0
But on the other side the integrated graphical programs of the Windows Version of the PowerShell don't work.
The Out-GridView creates and error.
That must be a problem on your side, as it runs fine here. Probably check your graphics driver setup. Does it run when you disable d3d9 (disable d3d9.dll in winecfg)?


I made an automatic installer that quickly works around 1st problem for a program i use (Waves) a while ago. You can find it here:
https://github.com/PietJankbal/powershe ... r-for-wine

It automatically runs powershell through conemu so no jumping cursors anymore ;)
Locked