Skip to content

Commit

Permalink
see change log for v3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Jun 24, 2019
1 parent 35b2638 commit ba5e7c2
Show file tree
Hide file tree
Showing 20 changed files with 199 additions and 194 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeLog for ISEScriptingGeek Module

## v3.4.1

+ Replaced `Out-Null` references to using `[void]`
+ Cleaned up incorrect exported aliases
+ Code clean up and reformatting

## v3.4.0

+ code cleanup as some commands have moved to the PSScriptTools module.
Expand Down
4 changes: 2 additions & 2 deletions ISEScriptingGeek.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
RootModule = 'ISEScriptingGeek.psm1'

# Version number of this module.
ModuleVersion = '3.4.0'
ModuleVersion = '3.4.1'

# ID used to uniquely identify this module
GUID = '6d1078ea-36c8-443a-9476-6d6c4d6ac834'
Expand Down Expand Up @@ -82,7 +82,7 @@ CmdletsToExport = @()
VariablesToExport = 'MySnippets', 'MyModules', 'MyPowerShell', 'CurrentProjectList'

# Aliases to export from this module
AliasesToExport = 'ccs','gcfg','gcfgs','gcmd','glcm','pbcfg','rtcfg','sacfg','slcm','tab','tcfg','upcfg','sd'
AliasesToExport = 'ccs','gcmd','glcm''tab','sd'

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
Binary file modified ISEScriptingGeek.psm1
Binary file not shown.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

[![PSGallery Version](https://img.shields.io/powershellgallery/v/ISEScriptingGeek.png?style=for-the-badge&logo=powershell&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/ISEScriptingGeek/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/ISEScriptingGeek.png?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/ISEScriptingGeek/)


This module is a set of ISE add-ons and a few themes. It requires PowerShell 4.0 or higher.

_As of February 2019 I no longer intend to update or extend this module. VS Code is clearly Microsoft's choice for a scripting tool going forward. The PowerShell ISE isn't going away any time soon, but it is also no longer under active development so I need no point in continuing to develop this module. I will maintain it and address pull requests should members of the community wish to contribute, maintain or extend this module._

## Themes

The themes can be found and imported from the Themes subfolder of the module.
The themes can be found and imported from the Themes sub-folder of the module.
These are optional and are not connected to the add-ons.

## Add-ons

Once the module is imported, the add-ons will be listed under **ISE Scripting Geek** on the **Add-ons** menu in the ISE.
A number of the add-ons fall into grouped subfolders:
A number of the add-ons fall into grouped sub-folders:

### Bookmarks

Expand All @@ -41,9 +40,10 @@ A set of functions for working with open files and their associated folders

A set of functions for creating and managing a "work list" of files

### Misc
### Miscellaneous

There are also other scripts directly off the **ISE Scripting Geek** menu, these functions provide various capabilities:

- Print, Run or Sign script
- Send script to Word (with or without color)
- Send selected text to different search engines
Expand All @@ -52,4 +52,4 @@ There are also other scripts directly off the **ISE Scripting Geek** menu, these

Please submit issues for defects, enhancements, or documentation.

*Last updated 21 February 2019*
*Last 2019-06-24 14:25:59Z UTC*
174 changes: 87 additions & 87 deletions functions/Bookmarks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,116 +2,116 @@
#create a script bookmarking system for the PowerShell ISE

Function Get-ISEBookmark {
[cmdletbinding()]
Param()

Write-Verbose "Importing bookmarks from $MyBookmarks"
Try {
Import-CSV $MyBookmarks -ErrorAction Stop |
Out-GridView -Title "My ISE Bookmarks" -OutputMode Single
}
Catch {
Write-Warning "Failed to find or import bookmarks from $($MyBookmarks). Does file exist?"
}
[cmdletbinding()]
Param()

Write-Verbose "Importing bookmarks from $MyBookmarks"
Try {
Import-CSV $MyBookmarks -ErrorAction Stop |
Out-GridView -Title "My ISE Bookmarks" -OutputMode Single
}
Catch {
Write-Warning "Failed to find or import bookmarks from $($MyBookmarks). Does file exist?"
}
} #close Get-ISEBookmark

Function Open-ISEBookmark {
[cmdletbinding()]
Param()
[cmdletbinding()]
Param()

$bookmark = Get-ISEBookmark

$bookmark = Get-ISEBookmark
if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"

if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"

#open the file
psedit $bookmark.path
#open the file
psedit $bookmark.path

#find the file in the collection of open files
$search = $psise.CurrentPowerShellTab.files.where({$_.fullpath -eq $bookmark.path})
#find the file in the collection of open files
$search = $psise.CurrentPowerShellTab.files.where( {$_.fullpath -eq $bookmark.path})

#make the file the currently selected
$psise.CurrentPowerShellTab.files.SelectedFile = $search[0]
#make the file the currently selected
$psise.CurrentPowerShellTab.files.SelectedFile = $search[0]

#jump to the bookmark location
Write-Verbose "Jumping to line $($Bookmark.LineNumber)"
$search[0].editor.SetCaretPosition($bookmark.LineNumber,1)
} #if bookmark
#jump to the bookmark location
Write-Verbose "Jumping to line $($Bookmark.LineNumber)"
$search[0].editor.SetCaretPosition($bookmark.LineNumber, 1)
} #if bookmark

} #close Open-ISEBookmark

Function Remove-ISEBookmark {
[cmdletbinding(SupportsShouldProcess)]
Param()
[cmdletbinding(SupportsShouldProcess)]
Param()

$bookmark = Get-ISEBookmark
$bookmark = Get-ISEBookmark

if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"
$save = Import-CSV -Path $MyBookmarks | where {$_.id -notmatch $bookmark.id}
Write-Verbose "Updating $MyBookmarks"
$save | Export-Csv -Path $MyBookmarks -Encoding ASCII
if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"
$save = Import-CSV -Path $MyBookmarks | where {$_.id -notmatch $bookmark.id}
Write-Verbose "Updating $MyBookmarks"
$save | Export-Csv -Path $MyBookmarks -Encoding ASCII

} #if bookmark
} #if bookmark

} #close Remove-ISEBookmark

Function Update-ISEBookmark {
[cmdletbinding()]
Param(
[Parameter(Position=0,ValueFromPipeline)]
[object]$Bookmark
)

$bookmark = Get-ISEBookmark

if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"
$line = New-Inputbox -Prompt "Enter the line number" -Title $MyInvocation.MyCommand -Default $Bookmark.LineNumber
if ($line) {
$name = New-Inputbox -Prompt "Enter the name" -Title $MyInvocation.MyCommand -Default $Bookmark.name
}
else {
#nothing entered so bail out
Write-Verbose "Cancelling"
Return
}

If ($name) {

#get all bookmarks
$all = Get-content -Path $MyBookmarks | ConvertFrom-Csv

#get matching bookmark by ID from CSV file
$bmk = $all.where({$_.id -eq $bookmark.id})

#update the entry
$bmk[0].Linenumber = $line
$bmk[0].name = $name
#save the results back to the file
$all | Export-Csv -Path $MyBookmarks
}
else {
#cancelling
Write-Verbose "Cancelling"
}
} #close if bookmark
[cmdletbinding()]
Param(
[Parameter(Position = 0, ValueFromPipeline)]
[object]$Bookmark
)

$bookmark = Get-ISEBookmark

if ($bookmark) {
Write-Verbose "Processing bookmark $($bookmark.name) for $($bookmark.path)"
$line = New-Inputbox -Prompt "Enter the line number" -Title $MyInvocation.MyCommand -Default $Bookmark.LineNumber
if ($line) {
$name = New-Inputbox -Prompt "Enter the name" -Title $MyInvocation.MyCommand -Default $Bookmark.name
}
else {
#nothing entered so bail out
Write-Verbose "Cancelling"
Return
}

If ($name) {

#get all bookmarks
$all = Get-content -Path $MyBookmarks | ConvertFrom-Csv

#get matching bookmark by ID from CSV file
$bmk = $all.where( {$_.id -eq $bookmark.id})

#update the entry
$bmk[0].Linenumber = $line
$bmk[0].name = $name

#save the results back to the file
$all | Export-Csv -Path $MyBookmarks
}
else {
#cancelling
Write-Verbose "Cancelling"
}
} #close if bookmark

} #close Update-ISEBookmark

Function Add-ISEBookmark {

$line = $psise.CurrentFile.Editor.CaretLine
$path = $psise.CurrentFile.FullPath
$name = New-Inputbox -Prompt "Enter a name or description for this bookmark." -Title "Add ISE Bookmark"

$obj = [pscustomobject]@{
ID = [guid]::NewGuid().guid
LineNumber = $line
Name = $name
Path = $Path
}
$obj | Export-Csv -Path $MyBookmarks -Append -Encoding ASCII
$line = $psise.CurrentFile.Editor.CaretLine
$path = $psise.CurrentFile.FullPath
$name = New-Inputbox -Prompt "Enter a name or description for this bookmark." -Title "Add ISE Bookmark"

$obj = [pscustomobject]@{
ID = [guid]::NewGuid().guid
LineNumber = $line
Name = $name
Path = $Path
}
$obj | Export-Csv -Path $MyBookmarks -Append -Encoding ASCII

} #close Add-ISEBookmark
10 changes: 5 additions & 5 deletions functions/CIMScriptMaker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Function New-CIMCommand {

#browse namespaces
Write-Host "Enumerating namspaces on $computername....please wait..." -ForegroundColor Cyan
$ns = Get-Namespace -CimSession $cimsess | Sort |
$ns = Get-Namespace -CimSession $cimsess | Sort-Object |
Out-GridView -Title "$($cimsess.Computername): Select a namespace" -OutputMode Single

if ($ns) {
#get classes filtering out system classes
Write-Host "Enumerating classes...please wait..." -ForegroundColor Cyan
$class = $cimsess | Get-CimClass -Namespace $ns |
Where {$_.cimclassname -notmatch "^__" -AND $_.CimClassProperties.Name -notcontains "Antecedent"} |
Sort CimClassName | Select CimClassName, CimClassProperties |
Where-Object {$_.cimclassname -notmatch "^__" -AND $_.CimClassProperties.Name -notcontains "Antecedent"} |
Sort-Object CimClassName | Select-Object CimClassName, CimClassProperties |
Out-GridView -Title "$NS : Select a class name" -OutputMode Single
}

Expand Down Expand Up @@ -69,7 +69,7 @@ Function New-CIMCommand {
$cmd = "Get-CimInstance @cimParam"

#create a filter
$filterProperty = $class.CimClassProperties | Select Name, CimType, Flags |
$filterProperty = $class.CimClassProperties | Select-Object Name, CimType, Flags |
Out-GridView -Title "Select a property to filter on or cancel to not filter." -OutputMode Single

if ($filterProperty) {
Expand All @@ -89,7 +89,7 @@ Function New-CIMCommand {

#show properties
Write-Host "Getting class properties" -ForegroundColor Cyan
$properties = $class.CimClassProperties | select Name, CimType, Flags |
$properties = $class.CimClassProperties | Select-Object Name, CimType, Flags |
Out-Gridview -Title "$($class.CimClassName) : Select one or more properties. Cancel will select *" -PassThru

if ($properties) {
Expand Down
4 changes: 2 additions & 2 deletions functions/CloseAllFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Function CloseAllFiles {
$saved = $psISE.CurrentPowerShellTab.Files.Where( {$_.isSaved})
foreach ($file in $saved) {
write-Verbose "closing $($file.FullPath)"
$psISE.CurrentPowerShellTab.files.Remove($file) | out-null
[void]$psISE.CurrentPowerShellTab.files.Remove($file)
}

} #end function
Expand All @@ -22,7 +22,7 @@ Function CloseAllFilesButCurrent {
$saved = $psISE.CurrentPowerShellTab.Files.Where( {$_.isSaved -AND $_.fullpath -ne $psISE.CurrentFile.FullPath })
foreach ($file in $saved) {
write-Verbose "closing $($file.FullPath)"
$psISE.CurrentPowerShellTab.files.Remove($file) | out-null
[void]$psISE.CurrentPowerShellTab.files.Remove($file)
}

} #end function
Binary file modified functions/ConvertAll.ps1
Binary file not shown.
2 changes: 1 addition & 1 deletion functions/ConvertTo-CommentHelp.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


Function ConvertTo-CommentHelp {

[cmdletbinding()]
Param()

Add-Type -AssemblyName "microsoft.visualbasic" -ErrorAction Stop
Expand Down
Binary file modified functions/ConvertTo-TextFile.ps1
Binary file not shown.
Loading

0 comments on commit ba5e7c2

Please sign in to comment.