# Setup variables $GitURI = "https://git.wnd.sh/n/PSGraylog/archive/main.zip" # Defaults to the first module path, however you can change this to any path you wish (provided it's in your $PSModulePath) $OutputPath = "$($env:PSModulePath.Split(";")[0])/PSGraylog" Invoke-WebRequest $GitURI -OutFile "$OutputPath.zip" Expand-Archive "$OutputPath.zip" $OutputPath # The archive nests the files, so we need to move the up a level Move-Item "$OutputPath/PSGraylog/*" $OutputPath # Remove the excess PSGraylog directory (it's empty) Remove-Item "$OutputPath/PSGraylog" # Remove the archive Remove-Item "$OutputPath.zip"