Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped it in a VS project and added a check for PSISE #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions PoShGist.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
. (Join-Path $PSScriptRoot Send-Gist.ps1)
. (Join-Path $PSScriptRoot Test-Gist.ps1)

function Add-MenuItem {
param([string]$DisplayName, $SB, $ShortCut)
if ($PSISE) {

$menu=$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus | Where {$_.DisplayName -Match $DisplayName}
function Add-MenuItem {
param([string]$DisplayName, $SB, $ShortCut)

if($menu) {
[void]$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Remove($menu)
$menu=$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus | Where {$_.DisplayName -Match $DisplayName}

if($menu) {
[void]$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Remove($menu)
}

[void]$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add($DisplayName, $SB, $ShortCut)
}

[void]$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add($DisplayName, $SB, $ShortCut)
}
Add-MenuItem '_Send Gist' { Send-Gist } 'CTRL+Shift+S'

Add-MenuItem '_Send Gist' { Send-Gist } 'CTRL+Shift+S'
}
36 changes: 36 additions & 0 deletions Posh-Gist.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Module manifest for module Posh-Gist
# Generated by: Josh Einstein
# Generated on: 2016-02-12

@{

Description = "Fork of Doug Finke's Posh-Gist module."
ModuleVersion = '1.0'
GUID = 'bd4390dc-a8ad-4bce-8d69-f53ccf8e4163'
Author = 'Doug Finke'
CompanyName = ''
Copyright = ''


RequiredModules = @()
RequiredAssemblies = @()

RootModule = 'PoshGist.psm1'
ScriptsToProcess = @()
TypesToProcess = @()
FormatsToProcess = @()
NestedModules = @()

FunctionsToExport = @(
'Get-Gist'
'Get-GistAuthHeader'
'Get-GistContent'
'Remove-Gist'
'Send-Gist'
'Test-Gist'
)
#CmdletsToExport = '*'
#VariablesToExport = '*'
#AliasesToExport = '*'

}
45 changes: 45 additions & 0 deletions Posh-Gist.pssproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>6CAFC0C6-A428-4d30-A9F9-700E829FEA51</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>MyApplication</RootNamespace>
<AssemblyName>MyApplication</AssemblyName>
<Name>Posh-Gist</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Folder Include="Tests\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Get-Gist.ps1" />
<Compile Include="Get-GistAuthHeader.ps1" />
<Compile Include="Get-GistContent.ps1" />
<Compile Include="Posh-Gist.psd1" />
<Compile Include="Tests\Posh-Gist.tests.ps1" />
<Compile Include="PoShGist.psm1" />
<Compile Include="Remove-Gist.ps1" />
<Compile Include="Send-Gist.ps1" />
<Compile Include="Test-Gist.ps1" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="Build" />
</Project>
28 changes: 28 additions & 0 deletions Posh-Gist.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F5034706-568F-408A-B7B3-4D38C6DB8A32}") = "Posh-Gist", "Posh-Gist.pssproj", "{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E7DEA85B-7CE0-4DE1-93E9-18B2F36B8C85}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
UsingPoshGist.gif = UsingPoshGist.gif
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions Tests/Posh-Gist.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# This is a PowerShell Unit Test file.
# You need a unit test framework such as Pester to run PowerShell Unit tests.
# You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084
#

Describe "Get-Gist" {

Context "Function Exists" {

It "Should Return" {

}

}

}