Skip to content

Commit

Permalink
Added Remove-Gist function
Browse files Browse the repository at this point in the history
  • Loading branch information
gravejester committed Oct 5, 2014
1 parent a59f643 commit 1a3b982
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Posh-Gist
Share your PowerShell scripts easily with [GitHub Gists](https://gist.github.com/) and Send-Gist.

After doing an `Import-Module Gist` ***Ctrl+Shift+S*** is wired up in PowerShell ISE. Load up a script or write one from scratch, press the shortcut keys and you've created a gist.
**NOTE** If a selection is made, only the selection will be used for the new gist.
**NOTE.** If a selection is made, only the selection will be used for the new gist.

![Image](https://raw.github.com/dfinke/Posh-Gist/master/UsingPoshGist.gif)

Expand All @@ -12,6 +12,6 @@ You need a [GitHub](https://github.com/join) account to post a gist, this does n
ToDo
-
* ~~Add Updating an existing gist~~
* Add Deleting an existing gist
* ~~Add Deleting an existing gist~~
* ~~Expand capabilities to send files on disk~~
* ~~Load an existing gist into ISE~~
9 changes: 9 additions & 0 deletions Remove-Gist.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Remove-Gist {
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[string]$GistID
)

Begin { $Header = Get-GistAuthHeader }
Process { Invoke-RestMethod -Method 'Delete' -Uri "https://api.github.com/gists/$($GistID)" -Headers $Header }
}

0 comments on commit 1a3b982

Please sign in to comment.