Code Monkey home page Code Monkey logo

Comments (7)

KevinMarquette avatar KevinMarquette commented on August 23, 2024

Absolutely. That looks like a good path to add to the list.

from psgraph.

tigerfansga avatar tigerfansga commented on August 23, 2024

PR submitted. I know you have login in Install-GraphViz for Windows and MacOS. For Linux, because of the variability in distos and package managers, I'm not sure of the best options for this command.

For ubuntu (and other debian distros), you would use sudo apt install graphviz for REHL and other similar distros, it would probably be a yum command.

from psgraph.

KevinMarquette avatar KevinMarquette commented on August 23, 2024

I wasn't sure how to handle all those possibilities either and I'm not sure that command belongs in this module.

from psgraph.

tigerfansga avatar tigerfansga commented on August 23, 2024

I was thinking more displaying the command but not executing it

from psgraph.

KevinMarquette avatar KevinMarquette commented on August 23, 2024

I would be good with that solution. That lets the user make the call.

I guess I we should also include a link to the graphviz documentation on how to download it. https://www.graphviz.org/download

from psgraph.

Stephanevg avatar Stephanevg commented on August 23, 2024

hi, guys,

I think it would be too bad to have the user usability be diffferent for linux then for macosx and windows.
I perhaps have a small suggestion. Please let me know if this is something that could be acceptable:

    <#
        .Description
        Installs GraphViz package using online provider
        .Example
        Install-GraphViz
    #>
    [cmdletbinding( SupportsShouldProcess = $true, ConfirmImpact = "High" )]
    param()

    process
    {
        try
        {
            if ( $IsOSX )
            {
                if ( $PSCmdlet.ShouldProcess( 'Install graphviz' ) )
                {
                    brew install graphviz
                }
            }Elseif($IsLinux){
                #Get the version, with something like this:
                #https://www.cyberciti.biz/faq/how-to-check-os-version-in-linux-command-line/
                $LinuxOs = ""

                switch($LinuxOs){
                    "RHEL" {yum graphviz;break}
                    "Ubuntu"{sudo apt install graphviz;break}
                    "Default"{throw "Os not supported yet. please open an issue here: https://github.com/KevinMarquette/PSGraph/issues"}

                }

            }
            else
            {
                if ( $PSCmdlet.ShouldProcess('Register Chocolatey provider and install graphviz' ) )
                {
                    if ( -Not ( Get-PackageProvider | Where-Object ProviderName -eq 'Chocolatey' ) )
                    {
                        Register-PackageSource -Name Chocolatey -ProviderName Chocolatey -Location http://chocolatey.org/api/v2/
                    }

                    Find-Package graphviz | Install-Package -Verbose -ForceBootstrap
                }
            }
        }
        catch
        {
            $PSCmdlet.ThrowTerminatingError( $PSitem )
        }
    }

I have no linux machine to test this one unfortunatley. perhaps @tigerfansga could give it a shot?

from psgraph.

tigerfansga avatar tigerfansga commented on August 23, 2024

One option to look at these is WSL on Windows 10.

I can do some checking on a few different distributions, but the variability in the Linux world will create gaps.

I can't confirm, but you will most likely need to use sudo for REHL with yum.

from psgraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.