Closed Ayanmullick closed 3 years ago
What version of PowerShell are you running?
PSVersion | 5.1.16299.251 |
---|---|
PSEdition | Desktop |
PSCompatibleVersions | {1.0, 2.0, 3.0, 4.0...} |
BuildVersion | 10.0.16299.251 |
CLRVersion | 4.0.30319.42000 |
WSManStackVersion | 3 |
PSRemotingProtocolVersion | 2.3 |
SerializationVersion | 1.1.0.1 |
Using this for now
$User = 'Ayanmullick'
$Repo = 'test'
$Module = 'HelloWorld' #Replace with Script name
$DestPath= New-Item -Path ([Environment]::GetFolderPath('MyDocuments')+"\PowerShell\Modules") -Name $Module -ItemType "directory" #Create directory in User's default Module folder
(New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/$User/$Repo/master/$Module.psm1","$DestPath\$Module.psm1") #Download module
I'm unable to get this to work. I have a 'Hello World' test module in my Github repository but get an error
Cmdlet :
Install-ModuleFromGitHub -GitHubRepo /AyanMullick/test/master/HelloWorld.psm1
Error:
Invoke-RestMethod : The remote server returned an error: (404) Not Found. At C:\Program files\WindowsPowerShell\Modules\InstallModuleFromGitHub\1.1\InstallModuleFromGitHub.psm1:40 char:19 Invoke-RestMethod $url -OutFile $OutFile