ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    PowerShell on Fedora 27

    IT Discussion
    linux powershell powershell on linux fedora 27
    4
    30
    4.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ObsolesceO
      Obsolesce
      last edited by

      What can/would you do with PowerShell on Linux? With BASH scripting, there really isn't a need for PowerShell on Linux, but I thought it would be interesting to play with. Perhaps for scripting things on Linux to control Windows machines and such, but this to be the topic for such things...

      I just installed PowerShell on my Fedora 27 laptop successfully using the following instructions:

      1. curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
      2. dnf update
      3. dnf install compat-openssl10
      4. dnf install -y powershell
      5. To start PowerShell, type: pwsh
      6. Get a list of commands, type: Get-Command or Get-Command -Noun/Verb noun/verb
        Example: Get-Command -Noun *drive* returns:
      PS /home/tgruber> Get-Command -Noun *drive*                                                                                                      
      
      CommandType     Name                                               Version    Source                                                            
      -----------     ----                                               -------    ------                                                            
      Cmdlet          Get-PSDrive                                        3.1.0.0    Microsoft.PowerShell.Management                                   
      Cmdlet          New-PSDrive                                        3.1.0.0    Microsoft.PowerShell.Management                                   
      Cmdlet          Remove-PSDrive                                     3.1.0.0    Microsoft.PowerShell.Management                                   
      
      1 Reply Last reply Reply Quote 1
      • ObsolesceO
        Obsolesce
        last edited by

        Lots of trouble connecting to remote hosts in PowerShell on Linux. Seems like too much work. Might just be better to use SSH.

        scottalanmillerS 1 Reply Last reply Reply Quote 1
        • scottalanmillerS
          scottalanmiller @Obsolesce
          last edited by

          @tim_g said in PowerShell on Fedora 27:

          Lots of trouble connecting to remote hosts in PowerShell on Linux. Seems like too much work. Might just be better to use SSH.

          SSH is what you'd be expected to use. PowerShell Remoting is really only for systems lacking SSH. And even Windows is moving to SSH default.

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            There is really nothing to do with PS on Linux other than use it to replace BASH, and that's mostly just to be weird.

            ObsolesceO 1 Reply Last reply Reply Quote 0
            • ObsolesceO
              Obsolesce @scottalanmiller
              last edited by

              @scottalanmiller said in PowerShell on Fedora 27:

              There is really nothing to do with PS on Linux other than use it to replace BASH, and that's mostly just to be weird.

              Yeah that's what I noticed when I was playing with it... it just brings PS familiarity, that's about it. I'd rather use BASH and SSH. And like you said, even Windows is moving to SSH.

              Posted before I played. But still good for others to see the conclusion.

              scottalanmillerS 1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @Obsolesce
                last edited by

                @tim_g said in PowerShell on Fedora 27:

                @scottalanmiller said in PowerShell on Fedora 27:

                There is really nothing to do with PS on Linux other than use it to replace BASH, and that's mostly just to be weird.

                Yeah that's what I noticed when I was playing with it... it just brings PS familiarity, that's about it. I'd rather use BASH and SSH. And like you said, even Windows is moving to SSH.

                Posted before I played. But still good for others to see the conclusion.

                That's all a shell would do. No different than ZSH, TCSH, CSH, KSH, FISH, etc. Shell is a shell.

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  Youtube Video

                  From just last week 🙂

                  1 Reply Last reply Reply Quote 0
                  • dbeatoD
                    dbeato
                    last edited by

                    Powershell on Deepin is lacking every two commands is segmentation fault...

                    scottalanmillerS black3dynamiteB 2 Replies Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @dbeato
                      last edited by

                      @dbeato said in PowerShell on Fedora 27:

                      Powershell on Deepin is lacking every two commands is segmentation fault...

                      Yeah, that's what I've found, doesn't seem to be stable.

                      1 Reply Last reply Reply Quote 1
                      • black3dynamiteB
                        black3dynamite @dbeato
                        last edited by black3dynamite

                        @dbeato said in PowerShell on Fedora 27:

                        Powershell on Deepin is lacking every two commands is segmentation fault...

                        Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                        dbeatoD scottalanmillerS 2 Replies Last reply Reply Quote 0
                        • dbeatoD
                          dbeato @black3dynamite
                          last edited by

                          @black3dynamite said in PowerShell on Fedora 27:

                          @dbeato said in PowerShell on Fedora 27:

                          Powershell on Deepin is lacking every two commands is segmentation fault...

                          Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                          That's great, but in this case is just basic commands I am doing.

                          black3dynamiteB 1 Reply Last reply Reply Quote 0
                          • black3dynamiteB
                            black3dynamite @dbeato
                            last edited by

                            @dbeato said in PowerShell on Fedora 27:

                            @black3dynamite said in PowerShell on Fedora 27:

                            @dbeato said in PowerShell on Fedora 27:

                            Powershell on Deepin is lacking every two commands is segmentation fault...

                            Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                            That's great, but in this case is just basic commands I am doing.

                            Which basic commands? I would like to see what happens when its used in a script.

                            dbeatoD 1 Reply Last reply Reply Quote 0
                            • dbeatoD
                              dbeato @black3dynamite
                              last edited by

                              @black3dynamite said in PowerShell on Fedora 27:

                              @dbeato said in PowerShell on Fedora 27:

                              @black3dynamite said in PowerShell on Fedora 27:

                              @dbeato said in PowerShell on Fedora 27:

                              Powershell on Deepin is lacking every two commands is segmentation fault...

                              Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                              That's great, but in this case is just basic commands I am doing.

                              Which basic commands? I would like to see what happens when its used in a script.

                              Get-ChildrenItem
                              black3dynamiteB 1 Reply Last reply Reply Quote 0
                              • black3dynamiteB
                                black3dynamite @dbeato
                                last edited by

                                @dbeato said in PowerShell on Fedora 27:

                                @black3dynamite said in PowerShell on Fedora 27:

                                @dbeato said in PowerShell on Fedora 27:

                                @black3dynamite said in PowerShell on Fedora 27:

                                @dbeato said in PowerShell on Fedora 27:

                                Powershell on Deepin is lacking every two commands is segmentation fault...

                                Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                That's great, but in this case is just basic commands I am doing.

                                Which basic commands? I would like to see what happens when its used in a script.

                                Get-ChildrenItem
                                

                                That should be Get-ChildItem

                                dbeatoD 2 Replies Last reply Reply Quote 0
                                • dbeatoD
                                  dbeato @black3dynamite
                                  last edited by

                                  @black3dynamite said in PowerShell on Fedora 27:

                                  @dbeato said in PowerShell on Fedora 27:

                                  @black3dynamite said in PowerShell on Fedora 27:

                                  @dbeato said in PowerShell on Fedora 27:

                                  @black3dynamite said in PowerShell on Fedora 27:

                                  @dbeato said in PowerShell on Fedora 27:

                                  Powershell on Deepin is lacking every two commands is segmentation fault...

                                  Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                  That's great, but in this case is just basic commands I am doing.

                                  Which basic commands? I would like to see what happens when its used in a script.

                                  Get-ChildrenItem
                                  

                                  That should be Get-ChildItem

                                  Dang it, I am too tired to type commands... and you are spot on tonight....

                                  1 Reply Last reply Reply Quote 0
                                  • dbeatoD
                                    dbeato @black3dynamite
                                    last edited by

                                    @black3dynamite said in PowerShell on Fedora 27:

                                    @dbeato said in PowerShell on Fedora 27:

                                    @black3dynamite said in PowerShell on Fedora 27:

                                    @dbeato said in PowerShell on Fedora 27:

                                    @black3dynamite said in PowerShell on Fedora 27:

                                    @dbeato said in PowerShell on Fedora 27:

                                    Powershell on Deepin is lacking every two commands is segmentation fault...

                                    Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                    That's great, but in this case is just basic commands I am doing.

                                    Which basic commands? I would like to see what happens when its used in a script.

                                    Get-ChildrenItem
                                    

                                    That should be Get-ChildItem

                                    But case in point, with correct command, then starting to type a filter see below:
                                    0_1514698105801_DeepinScreenshot_select-area_20171231002747.png

                                    black3dynamiteB 1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller @black3dynamite
                                      last edited by

                                      @black3dynamite said in PowerShell on Fedora 27:

                                      @dbeato said in PowerShell on Fedora 27:

                                      Powershell on Deepin is lacking every two commands is segmentation fault...

                                      Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                      Yeah, but PS doesn't run, it just crashes.

                                      1 Reply Last reply Reply Quote 0
                                      • black3dynamiteB
                                        black3dynamite @dbeato
                                        last edited by

                                        @dbeato said in PowerShell on Fedora 27:

                                        @black3dynamite said in PowerShell on Fedora 27:

                                        @dbeato said in PowerShell on Fedora 27:

                                        @black3dynamite said in PowerShell on Fedora 27:

                                        @dbeato said in PowerShell on Fedora 27:

                                        @black3dynamite said in PowerShell on Fedora 27:

                                        @dbeato said in PowerShell on Fedora 27:

                                        Powershell on Deepin is lacking every two commands is segmentation fault...

                                        Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                        That's great, but in this case is just basic commands I am doing.

                                        Which basic commands? I would like to see what happens when its used in a script.

                                        Get-ChildrenItem
                                        

                                        That should be Get-ChildItem

                                        But case in point, with correct command, then starting to type a filter see below:
                                        0_1514698105801_DeepinScreenshot_select-area_20171231002747.png

                                        What happens with this command Get-ChildItem | Select-Object Desktop?

                                        dbeatoD 1 Reply Last reply Reply Quote 0
                                        • dbeatoD
                                          dbeato @black3dynamite
                                          last edited by

                                          @black3dynamite said in PowerShell on Fedora 27:

                                          @dbeato said in PowerShell on Fedora 27:

                                          @black3dynamite said in PowerShell on Fedora 27:

                                          @dbeato said in PowerShell on Fedora 27:

                                          @black3dynamite said in PowerShell on Fedora 27:

                                          @dbeato said in PowerShell on Fedora 27:

                                          @black3dynamite said in PowerShell on Fedora 27:

                                          @dbeato said in PowerShell on Fedora 27:

                                          Powershell on Deepin is lacking every two commands is segmentation fault...

                                          Well to avoid errors when developing powershell scripts in Visual Studio Code on Linux. PowerShell needs to be installed.

                                          That's great, but in this case is just basic commands I am doing.

                                          Which basic commands? I would like to see what happens when its used in a script.

                                          Get-ChildrenItem
                                          

                                          That should be Get-ChildItem

                                          But case in point, with correct command, then starting to type a filter see below:
                                          0_1514698105801_DeepinScreenshot_select-area_20171231002747.png

                                          What happens with this command Get-ChildItem | Select-Object Desktop?

                                          It basically works, it is just random crashing. Powershell commands work, is the actual shell that drops.

                                          black3dynamiteB dbeatoD 2 Replies Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller
                                            last edited by

                                            @black3dynamite said in PowerShell on Fedora 27:

                                            Get-ChildItem | Select-Object Desktop

                                            I just did a full update on Deepin and pwsh is able to run some commands today. Last week it could run nothing.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post