Has anybody started working with the linux powershell cmdlets?

Welcome Forums General PowerShell Q&A Has anybody started working with the linux powershell cmdlets?

This topic contains 4 replies, has 2 voices, and was last updated by

 
Keymaster
2 years, 2 months ago.

  • Author
    Posts
  • #51229

    Participant
    Points: 0
    Rank: Member

    i don't have a test environment available yet, but after reading the full announcment:

    PowerShell DSC for Linux is now available!

    already have requests to start utilizing some of this functionality, namely user/group management on linux servers.

    wondered if anyone had started utilizing them and were willing to share

  • #51231

    Keymaster
    Points: 2
    Rank: Member

    So, do bear in mind that PowerShell on Linux is alpha, and isn't suitable for production environments in any way. That also means it isn't feature-complete. We don't, for example, know the full range of functionality that'll eventually be delivered, although we obviously do know that we'll be able to create our own functionality. Given that Linux manages users and groups (and damn near everything else) in text files, its likely we can do something like what Microsoft did for Cron jobs – wrap a command around the text file to ease the management burden.

    But it's super early days.

  • #51233

    Keymaster
    Points: 2
    Rank: Member

    And, I will point out that if you look at the Linux DSC stuff (which has been out for a while, and is distinct from PowerShell on Linux), it's got about a half-dozen resources, including one for users. The resource just hits the configuration files directly, rather than running PowerShell.

  • #51237

    Participant
    Points: 0
    Rank: Member

    yah the dsc stuff is where i saw actual cmdlets (and wow, not sure how i missed the dsc stuff in may concerning user mgmt)

    i hadn't seen anything published using those cmdlets yet.

    so any examples of usage would still be appreciated.

  • #51241

    Keymaster
    Points: 2
    Rank: Member

    Well... no, Linux DSC resources at present don't use cmdlets, because when that was released, there was no PowerShell on Linux to run the cmdlets. Go to the GitHub repo for the Linux DSC – you can see the contents of the _resources_ (which are not cmdlets). Linux calls them "providers," which Windows almost did. See https://github.com/Microsoft/PowerShell-DSC-for-Linux/tree/master/Providers.

    Or specifically, https://github.com/Microsoft/PowerShell-DSC-for-Linux/tree/master/Providers/nxUser for the nxUser provider. It's straight C – not a PowerShell cmdlet. As for usage examples, the docs are at https://github.com/Microsoft/PowerShell-DSC-for-Linux/tree/master/Docs.

    But you're not going to use the Linux DSC providers outside the context of DSC – you can't. They aren't standalone commands.

The topic ‘Has anybody started working with the linux powershell cmdlets?’ is closed to new replies.