Powershell Wrapping using Winexe / Linux

231 Views Asked by At

This is the powershell command which works fine under windows powershell cli.

Get-ChildItem -Path c:\backup -Recurse | 
     Where-Object {$_.length -gt 1GB} | 
        Sort-Object -Property Length |
            Format-Table  Name,@{name='Size GB';expression={$_.length/1GB}; FormatString='N2'} 

Is there any way I can execute this command using from linux like using WINEXE? howto wrap it?

winexe -U DC/ID%"PASSWORD" //10.0.0.1 'powershell.exe -command "Get-ChildItem -Path c:\backup -Recurse | Where-Object {$_.length -gt 1GB} |  Sort-Object -Property Length | Format-Table  Name,@{name='Size GB';expression={$_.length/1GB}"'
0

There are 0 best solutions below