Coder Social home page Coder Social logo

iricigor / installmodulefromgit Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 211 KB

Helps installing modules directly from GitHub or Azure DevOps

License: MIT License

PowerShell 100.00%
azure devops ado vsts github install-module git-clone git git-client powershellget

installmodulefromgit's Introduction

Hi there ๐Ÿ‘‹ I'm Igor ๐Ÿ‘‹ Welcome to my GitHub pages!

  • ๐Ÿ‡ท๐Ÿ‡ธ I was born in Prijepolje, Serbia

  • ๐Ÿ‡จ๐Ÿ‡ฟ I live in the Prague, Czechia

  • ๐Ÿ’ฌ Ask me about PowerShell (I โค๏ธ PowerShell !)

See also some of my other pages

LinkedIn Twitter Wikipedia Stack Overflow

My GitHub Skylines

installmodulefromgit's People

Contributors

iricigor avatar

Stargazers

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

Watchers

 avatar  avatar

installmodulefromgit's Issues

Access Denied error on Temp Dir?

Hello, I found your repo after not being able to get dfinkle's one to work - though the idea is super promising!

And I can get your module installed with no problem, everything looks good.
But when I go to use it as intended, I keep getting an Accessed Denied error on the temp dir it is trying to use...?
PS is running as Admin, I am a Local admin of the machine, and even if I specify a destination path, it never gets that far...
Am I missing something simple here?

.Net FrameWork Full Version : 4.8.04084
PowerShell Version          : 5.1.19041.2673
OS Version                  : Microsoft Windows 10 Enterprise  v. 22H2 Build. 19045.2728
--- [WITHOUT DESTINATION PATH] -----------------------------------------------------------------------------------

Remove-Item : Cannot remove item C:\Users\USERNAME\AppData\Local\Temp\01aefda8-69bf-48ec-82ea-9ca9b8193d59.tmp: 
The process cannot access the file 'C:\Users\USERNAME\AppData\Local\Temp\01aefda8-69bf-48ec-82ea-9ca9b8193d59.tmp' 
because it is being used by another process.

At C:\Program Files\WindowsPowerShell\Modules\InstallModuleFromGit\1.2.0\Public\Get-GitModule.ps1:53 char:17
+                 Remove-Item (Join-Path $tempDir '*') -Recurse -Force
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\USERNAME...ca9b8193d59.tmp:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand

--- [WITH DESTINATION PATH] ---------------------------------------------------------------------------------------
WARNING: Install-GitModule using path which is not in $Env:PSModulePath (O:\Temp\TestModules)

Remove-Item : Cannot remove item C:\Users\USERNAME\AppData\Local\Temp\f86a921e-06e3-4c96-b089-54ac0ef8fa52.tmp: 
The process cannot access the file 'C:\Users\USERNAME\AppData\Local\Temp\f86a921e-06e3-4c96-b089-54ac0ef8fa52.tmp' 
because it is being used by another process.

At C:\Program Files\WindowsPowerShell\Modules\InstallModuleFromGit\1.2.0\Public\Get-GitModule.ps1:53 char:17
+                 Remove-Item (Join-Path $tempDir '*') -Recurse -Force
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\USERNAME...4ac0ef8fa52.tmp:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand
--------------------------------------------------------------------------------------------------------------------

external help

  • implement external help for module
  • test it
  • mention in readme how to update help

Get-Module parameter Name

Get-Module -Name should check if already installed module has RepositoryUri parameter, and then use it as before.

do validation of ProjectUri parameter

at the moment whatever is passed at the end will be folder name, even if it is not valid name
for example, module PowerShellGet has ProjectUri this one https://go.microsoft.com/fwlink/?LinkId=828955 and that tries to create directory ?LinkId=828955

In should be expanded to https://github.com/PowerShell/PowerShellGet

Stripping .git from the module name

(Get-GitModule 'https://github.com/riedyw/PoshFunctions.git').Name returns PoshFunctions.git, which means the end of the module path ends as Modules/PoshFunctions.git - however, I'd prefer it to be Modules/PoshFunctions instead.

Since -DestinationPath is only for specifying a root directory, it would be nice if there were an option to manually specify what name I want the module to have and/or an option to strip the .git portion off the folder name.

Add more icons

  • downloads, language, ...
  • contribute, skype chat, etc.
  • open new issue

Update-GitModule with Gitlab

Module was successfully installed with
Install-GitModule https://git/XX/hotdog
and its commands are working. When trying to update via
Update-GitModule https://git/XX/hotdog
I get the error

PackageManagement\Get-Package : No match was found for the specified search criteria and module names 'hotdog'.
In C:\Users\XX\Documents\WindowsPowerShell\Modules\PowerShellGet\2.2.1\PSModule.psm1:9421 Zeichen:9
PackageManagement\Get-Package @PSBoundParameters | Microsoft. ...

CategoryInfo          : ObjectNotFound: (Microsoft.Power...lets.GetPackage:GetPackage) [Get-Package], Exception
FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackage

Looking through PackageManagement\Get-Package @PSBoundParameters does not include my module (why would it ^^). Am I doing something wrong?

The module is internal tooling and not available to the public. https://git is a locally running Gitlab server.

Get-GitHubModule

A function similar to Get-GitModule, just adopted for GitHub. It should not use git client for downloading, but a zip file.

Get-ADOModule

you can download zip also from ADO
test how it works with branches

update-gitmodule

Add cmdlet that will check for module version in git repo, and if newer, install it

master versus default branch

Usually default branch is master, but it is not mandatory. Try to check for default branch if -Branch is not specified.

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.