Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to create new repository in github via powershell

Function New-GitHubRepo{
        <#
    .SYNOPSIS
        Creates a new remote repository in GitHub
    .DESCRIPTION
        Creates a new remote repository in GitHub
    .PARAMETER UserName
        GitHub Username
    .PARAMETER ProjectName
        Name for the new remote GitHub repository
    .EXAMPLE
       New-GitHubRepo -UserName GUser -ProjectName "MyRepo"
    .NOTES
        Author: Michael Heath
          Date: 04/27/2019
    #>
Param(
    [Parameter(Mandatory = $true)][String]$UserName,
    [Parameter(Mandatory = $true)][String]$ProjectName
)

# This works for entering password
# New output file
$OutFile = ".ex.cmd"

# Var for Quote
$q = [char]34

# Create part of the command line with the project name
$t =  "$q{$q @@ name$q @@ :$q @@ $ProjectName$q}$q"

# Remove the space and the @@ symbols
$t = $t.replace(" @@ ", "")

# Add the curl command and the project
$t = "curl -u $UserName https://api.github.com/user/repos -d " + $t

# put contents in the ex.cmd file
"@echo off" | out-file $OutFile -Encoding ascii
$t | Out-File $OutFile -Encoding ascii -Append

# Execute the ex.cmd file - you will be prompted for your password
cmd.exe /C ".ex.cmd"
Comment

PREVIOUS NEXT
Code Example
Shell :: docker short flags 
Shell :: watchan windows latest release 
Shell :: hide folder staarted with dot on mac 
Shell :: ubuntu apt install default path 
Shell :: install gtk in msys2 shell 
Shell :: command to know wifi ubuntu running 64 or 32 bits 
Shell :: tableplus 
Shell :: how to chck if i have bluetooth in lunux machine 
Shell :: groovy parse dictionary 
Shell :: Cannot find plugin.xml for plugin @havesource 
Shell :: wingpersonal linux mint 
Shell :: install htttpd ubuntu 
Shell :: sudo apt-get -y install unity-greeter 
Shell :: how to use nohup 
Shell :: get all files from folders to 1 parent folder 
Shell :: To check the Logs in Ubuntu and Debian 
Shell :: proxmox pass raw disk 
Shell :: sudo nano search 
Shell :: using both ca cert and certificate between server and client 
Shell :: iterate through text files with spaces batch 
Shell :: sDepends: libgcc-s1 (= 3.0) but it is not installable 
Shell :: gk420t driver windows 
Shell :: android studio comment linux 
Shell :: pup command example 
Shell :: is wanted agency legit 
Shell :: nouveau bureau virtuel windows 10 
Shell :: what should be used to create scratch orgs 
Shell :: shell redirect otpt to multiple files 
Shell :: assing command to a variable 
Shell :: command operative system linux 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =