Skip to content
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
5 changes: 5 additions & 0 deletions Shell-Functions/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.ps1 text eol=lf
*.psm1 text eol=lf
*.psd1 text eol=lf
*.md text eol=lf
LICENSE text eol=lf
25 changes: 25 additions & 0 deletions Shell-Functions/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2019, Dima Stadub
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions Shell-Functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ Run Shell-Function.Tests.ps1 with Pester 4.10.1. CI tests imports/exports, real
filters and mocked link-provider arguments; it never runs cmd, changes Visual
Studio state, creates links or invokes the interactive prompt. This module has
no configured Gallery publication or release package.

## Package identity

The canonical module manifest is Shell-Functions.psd1 (version 0.0.1), matching
the proposed Gallery module name. Shell-Function.psd1 remains a source-compatible
manifest with the same metadata and exports. Commands and aliases are unchanged.
The module inherits the repository BSD-2-Clause license; the package carries the
same license text. Windows batch helpers and real link creation are not covered by
the import/filter/provider-argument tests. Gallery ownership is pending selection.
13 changes: 9 additions & 4 deletions Shell-Functions/Shell-Function.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
$manifest = Join-Path $PSScriptRoot 'Shell-Function.psd1'
$manifest = Join-Path $PSScriptRoot 'Shell-Functions.psd1'
$moduleName = 'Shell-Functions'
if (-not (Test-Path $manifest)) {
$manifest = Join-Path $PSScriptRoot 'Shell-Function.psd1'
$moduleName = 'Shell-Function'
}
Import-Module $manifest -Force -ErrorAction Stop
Describe 'Shell source imports and filters' {
It 'exports callable functions and resolvable aliases from its manifest' {
$module = Get-Module 'Shell-Function'
$module = Get-Module $moduleName
$module.ExportedFunctions.Count | Should -Be 7
$module.ExportedAliases.Count | Should -Be 7
$module.ExportedAliases.ContainsKey('pb') | Should -BeFalse
Expand All @@ -22,7 +27,7 @@ Describe 'Shell source imports and filters' {
('a b' | Split-String) -join '|' | Should -BeExactly 'a|b'
}
}
InModuleScope 'Shell-Function' {
InModuleScope $moduleName {
Describe 'Link provider argument contracts' {
It 'maps <Type> without creating a link' -TestCases @(
@{ Type='Symbolic'; Expected='SymbolicLink' }
Expand All @@ -39,4 +44,4 @@ InModuleScope 'Shell-Function' {
}
}
}
Remove-Module 'Shell-Function' -Force
Remove-Module $moduleName -Force
8 changes: 4 additions & 4 deletions Shell-Functions/Shell-Function.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CompanyName = 'Unknown'
Copyright = '(c) Dmitry.Stadub. All rights reserved.'

# Description of the functionality provided by this module
# Description = ''
Description = 'Text filters and Windows shell helper functions with module-scoped aliases.'

# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = ''
Expand Down Expand Up @@ -95,13 +95,13 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()
Tags = @('Shell', 'Text', 'Windows')

# A URL to the license for this module.
# LicenseUri = ''
LicenseUri = 'https://github.com/stadub/PowershellScripts/blob/master/LICENSE'

# A URL to the main website for this project.
# ProjectUri = ''
ProjectUri = 'https://github.com/stadub/PowershellScripts/tree/Shell-Functions/develop/Shell-Functions'

# A URL to an icon representing this module.
# IconUri = ''
Expand Down
122 changes: 122 additions & 0 deletions Shell-Functions/Shell-Functions.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#
# Module manifest for module 'Shell-Functions'
#
# Generated by: Dmitry.Stadub
#
# Generated on: 19.02.2019
#

@{

# Script module or binary module file associated with this manifest.
RootModule = 'Shell-Function.psm1'

# Version number of this module.
ModuleVersion = '0.0.1'

# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = 'b9a21ead-a6a2-45b2-bd44-068fa40d0283'

# Author of this module
Author = 'Dmitry.Stadub'

# Company or vendor of this module
CompanyName = 'Unknown'

# Copyright statement for this module
Copyright = '(c) Dmitry.Stadub. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Text filters and Windows shell helper functions with module-scoped aliases.'

# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = ''

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Get-SearchAndPrint', 'Split-String', 'Get-Batchfile', 'Initialize-VisualStudioEnvieronment', 'Get-CmdletAlias', 'New-FileSystemLink', 'Propmpt')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @('grep', 'cut', 'VsVars32', 'ga', 'ln', 'mklink', 'which')

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('Shell', 'Text', 'Windows')

# A URL to the license for this module.
LicenseUri = 'https://github.com/stadub/PowershellScripts/blob/master/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/stadub/PowershellScripts/tree/Shell-Functions/develop/Shell-Functions'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
25 changes: 25 additions & 0 deletions Shell-Functions/out/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2019, Dima Stadub
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 26 additions & 0 deletions Shell-Functions/out/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Shell-Functions source module

Import Shell-Function.psd1 to load the existing shell filters and helpers. The
manifest previously imported nothing and exported no commands. The loader now
exports seven existing functions and seven aliases without global-scope alias
writes. The stale pb alias is omitted because Export-Module is absent, and the protected
PowerShell fl (Format-List) alias is preserved; ln/mklink call the link helper.

This source repair corrects Split-String's accidental method-property access,
binds New-FileSystemLink to its existing LinkType enum, and maps enum values to
PowerShell provider item types. The spelling of existing public command/parameter
names is retained. Windows batch/Visual Studio helpers are not executed at import.

Run Shell-Function.Tests.ps1 with Pester 4.10.1. CI tests imports/exports, real text
filters and mocked link-provider arguments; it never runs cmd, changes Visual
Studio state, creates links or invokes the interactive prompt. This module has
no configured Gallery publication or release package.

## Package identity

The canonical module manifest is Shell-Functions.psd1 (version 0.0.1), matching
the proposed Gallery module name. Shell-Function.psd1 remains a source-compatible
manifest with the same metadata and exports. Commands and aliases are unchanged.
The module inherits the repository BSD-2-Clause license; the package carries the
same license text. Windows batch helpers and real link creation are not covered by
the import/filter/provider-argument tests. Gallery ownership is pending selection.
3 changes: 3 additions & 0 deletions Shell-Functions/out/Shell-Alias.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Set-Alias ln New-FileSystemLink
Set-Alias mklink New-FileSystemLink
Set-Alias which Get-Command
Loading