GithubHelp home page GithubHelp logo

nexushell's Introduction

Hi there ๐Ÿ‘‹ , I'm @steviecoaster!

PS | 1:08 PM | Choco Stuff> Get-GithubBio

Name        : Stephen Valdinger
Company     : Chocolatey Software
Title       : Support Manager
Hobbies     : {woodworking, fishing, music}
Description : Hi! I'm Stephen! I'm passionate about PowerShell, and software automation. I also thoroughly enjoy 
helping other level up their skillsets,either directly by sharing my knowledge, or by connecting them to someone 
in the industry with expertise in the area of their question.
Tagline     : Software Automation: I know a thing or two, because I've seen a thing or two!

nexushell's People

Contributors

jpruskin avatar steviecoaster avatar windos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nexushell's Issues

New-NexusRawComponent Needs better validation

A couple of things to note:

  • When running New-NexusRawComponent prior to running Connect-NexusServer, receive the error: Invoke-WebRequest: Invalid URI: The hostname could not be parsed.
  • When running New-NexusRawComponent while pointing to a file that doesn't exist, receive the error: Invoke-WebRequest: Cannot find path '<path/to/file>' because it does not exist.

I realize this is a pretty trash issue, but if someone cough @steviecoaster cough would provide a reasonable template for issues I would be glad to fill it out ๐Ÿคช

Get-NexusNuGetApiKey does not work with a user not authenticated through Connect-NexusServer

This is because it (and the child function for getting a token) use the $script:Header containing the auth token for the original user.

I see a few ways to sort this:

  • Replace the use of $Header within the two functions with a base authentication token generated from the passed Credential
  • Require that folk run Connect-NexusServer before using it

I feel the former feels better. I'll happily submit a PR shortly, if that seems reasonable.

Feature Request: Remove-NexusComponent

There's currently not a way to remove a nexus component, though we can remove an asset.

After work today, it seems that it would be handy if there was a way to do this! I used the following (taken from here):

InModuleScope NexuShell {
    $null = Invoke-Nexus -UriSlug "/service/rest/v1/components/$($Package.Id)" -Method DELETE
}

There could easily be a quick function added for this.

Generate docs as part of build

The build pipeline should process the PowerShell scripts and write Markdown help automatically, and publish these help files to the docs site for this module.

Set-NexusUserPassword reports "Unsupported Media Type"

When trying to set a password using Set-NexusUserPassword, I'm getting an error related to the media type being unsupported.

Set-NexusUserPassword -Username admin -NewPassword ("Sausage2021" | ConvertTo-SecureString -AsPlainText -Force)
Invoke-RestMethod : The remote server returned an error: (415) Unsupported Media Type.
At C:\Program Files\WindowsPowerShell\Modules\NexuShell\1.0.0\NexuShell.psm1:106 char:9
+         Invoke-RestMethod @Params
+         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Feature Request: Update File BlobStore Path

As someone setting up a Nexus instance, I may want to move the default blobstore to another drive or location.

Issue

There's currently seems to be no way to update the path of a blobstore, e.g. the default blob store created on initial installation.

Request

There is an endpoint to do this (PUT /v1/blobstores/file/{name}).

image

It would be ideal if there was a function to update blob store values, rather than having to delete and recreate the blobstore - this won't work unless there are no current repositories available (which is mostly fine).

Given the specificity of the endpoint, I would suggest Set- or Update-NexusFileBlobStore. You could potentially add some kind of migration function, but I think that's out of scope of this module.

Set-NexusUser requires parameters (some of which can't be supplied)

This was spotted against Nexus OSS 3.31.1-01

When running Set-NexusUser with limited parameters, there is an error stating that more parameters are required.

Set-NexusUser -Username admin -Status Active
Invoke-RestMethod : [{"id":"PARAMETER roles","message":"must not be empty"},{"id":"PARAMETER userId","message":"must not be blank"},{"id":"PARAMETER firstName","message":"must not be empty"},{"id":"PARAMETER 
source","message":"must not be blank"},{"id":"PARAMETER lastName","message":"must not be empty"},{"id":"PARAMETER emailAddress","message":"must not be empty"}]
At C:\Program Files\WindowsPowerShell\Modules\NexuShell\1.0.0\NexuShell.psm1:106 char:9
+         Invoke-RestMethod @Params
+         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Most of these should (but currently aren't) being satisfied by the existing values on the user, but those aren't coming through properly.

If you manually provide them to the function, those are removed from the list as being needed.

Set-NexusUser -Username admin -Status Active -FirstName 'Administrator' -LastName 'User' -EmailAddress '[email protected]' -Roles 'nx-admin'
Invoke-RestMethod : [{"id":"PARAMETER userId","message":"must not be blank"},{"id":"PARAMETER source","message":"must not be blank"}]
At C:\Program Files\WindowsPowerShell\Modules\NexuShell\1.0.0\NexuShell.psm1:106 char:9
+         Invoke-RestMethod @Params
+         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

There are two remainders:

  1. It looks like userName should be going through as userId
  2. There also needs to be source, which is available on the original user object

An aside: the docs also reference a Password parameter which I assume is from before the Set-NexusUserPassword function was done.

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.