10000 GitHub - Ishaski/slash: A Powershell module that converts Windows-style paths to Unix-style paths
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Ishaski/slash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Slash

A Powershell module that converts Windows-style paths to Unix-style paths

  To install a PowerShell module from a .psm1 file, you have several options:

Manual Installation

  1. Locate the appropriate module directory:

    • For current user: $HOME\Documents\WindowsPowerShell\Modules
    • For all users: $env:ProgramFiles\WindowsPowerShell\Modules
  2. Create a new folder with the same name as your module in the chosen directory.

  3. Copy the .psm1 file into the newly created folder.

  4. Import the module using:

    Import-Module ModuleName

Using PsGet

The PsGet module offers an alternative method:

  1. Import PsGet:

    Import-Module PsGet -Prefix GH
  2. Install the module using the -ModulePath parameter:

    Install-GHModule -ModulePath "C:\Path\To\YourModule.psm1"

Automatic Import

To avoid manually importing the module in new sessions:

  1. Add the Import-Module command to your PowerShell profile:

    Add-Content $PROFILE "`nImport-Module ModuleName"
  2. Alternatively, place the module in a directory listed in $env:PSModulePath for automatic loading.

Verification

After installation, verify the module is available:

Get-Module -ListAvailable ModuleName

Remember to replace "ModuleName" with your actual module name in these commands[1][3][4][5].

Citations: [1] https://superuser.com/questions/1581196/how-can-i-run-psd1-and-psm1-files-in-powershell [2] https://www.techthoughts.info/powershell-modules/ [3] https://www.comparitech.com/net-admin/install-powershell-modules/ [4] https://stackoverflow.com/questions/55404016/how-do-i-install-a-module-using-a-psm1-file [5] https://learn.microsoft.com/de-de/powershell/scripting/developer/module/installing-a-powershell-module?view=powershell-7.4 [6] https://valoremreply.com/resources/insights/blog/2020/january/creating-a-powershell-module/ [7] https://activedirectorypro.com/install-powershell-modules/

oversimplified windows Installation

  1. Create a folder named slash in your PowerShell module path (usually %WINDIR%/system32/WindowsPowerShell/v1.0/Modules).
  2. Copy slash.psm1 to the folder you created in step 1.
  3. Restart PowerShell.

 

Usage

slash -path {wanted_path} -with_drive {$true|$false}

 

Examples

  • slash -path "C:\Windows\System32\WindowsPowerShell" -with_drive $true

    -> Output:   C:/Windows/System32/WindowsPowerShell

  • slash -path "C:\Windows\System32\WindowsPowerShell" -with_drive $false

    -> Output:   /Windows/System32/WindowsPowerShell

  • slash C:\Windows\System32\WindowsPowerShell 0

    -> Output:   C:/Windows/System32/WindowsPowerShell

  • slash C:\Windows\System32\WindowsPowerShell

    -> Output:   /Windows/System32/WindowsPowerShell

About

A Powershell module that converts Windows-style paths to Unix-style paths

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%
0