Giter Site home page Giter Site logo

grimaceofdespair / hub-powershell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blackducksoftware/hub-powershell

0.0 2.0 0.0 42 KB

CLI and automation for Black Duck Hub via PowerShell 6.0.1 and later.

License: Apache License 2.0

C# 23.58% PowerShell 76.42%

hub-powershell's Introduction

PowerShell Core modules for Hub

With PowerShell, it is easier than ever to perform and automate routine Black Duck Hub tasks and generate custom reports not provided by the web interface.

Under Construction ๐Ÿšง

Caution: These tools are currently are still under development. They are not presently supported by Black Duck, and your use of them is entirely at your own risk.

Installation from PowerShell Gallery

In Power-Shell, enter:

    Install-Module BlackDuck.Hub

Building

Requires .Net Core 2.0+

Switch to the src directory and run dotnet build

Installing from Local Build

Copy the "publish" directory into the PowerShell Modules directory with the name BlackDuck.Hub. e.g.

Copy-Item -Recurse  -Recurse ./publish "$(($env:PSModulePath -split ':')[0])/BlackDuck.Hub" 

Publishing to PSGallery

  1. Increment the version number in BlackDuck.Hub.psd1
  2. Build and install using the instructions above
  3. Run
    Publish-Module -Name Blackduck.Hub -NuGetApiKey $nugetApiKey

(Your Nuget API key can be obtained from your profile at https://www.powershellgallery.com/account)

Examples

Show all component versions in the BOM of project 'madplay1'

Get-HubProject -name madplay | Get-HubProjectVersion | Get-HubComponentVersion 

Show all component versions in the BOM of project 'madplay1' with high risks.

Get-HubProject -name madplay | Get-HubProjectVersion | Get-HubComponentVersion | ? {$_.LicenseRiskProfile.High -gt 0 }     

Generate a license notification file for a project

# First, we get all the component versions as above
$allComponents = Get-HubProject -name madplay  | Get-HubProjectVersion | Get-HubComponentVersion

# Then, we get all the licenses fields of all the versions (these don't contain license texts),
# and expand any conjunctive or disjunctive licenses (unwrap) into their constituent parts
$unwrappedLicenses = $allComponents | select -ExpandProperty Licenses | Unwrap-HubLicense 

# Remove duplicate licenses and get license texts from the Hub
$licenseTexts = $unwrappedLicenses | select -Unique | Get-HubLicenseText

# Finally, combine the license texts into a single string and write them to a file
$separator = "`n`n==============================================================`n`n"
[string]::Join($separator, $licenseTexts) | Out-File /var/tmp/licenses.txt 

Get all the project versions affected by vulnerability notifications.

Get-HubNotifications | ? Type -eq 'Vulnerability' | select -Expand AffectedProjectVersions | Get-HubProjectVersion

Copyright ยฉ 2018 Synopsys, Inc. All Rights Reserved.

hub-powershell's People

Watchers

 avatar  avatar

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.