Skip to content

Powershell module providing a few useful command line functions

License

Notifications You must be signed in to change notification settings

gsej/PSDevtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSDevtools

Table of contents:

Overview

When developing on Windows, I keep a few powershell consoles open (I use conemu) and perform a lot of actions from the command-line. PSDevtools is a set of small command-line functions that I find helpful while working like this.

Versions

PSDevtools v1.0

  • Initial version.
  • Includes Open-Solution function.

Installation

Prerequisites

Before installing PSDevtools make sure the following prerequisites have been met.

  1. Windows PowerShell 5, 6 or 7

    Check your PowerShell version by executing $PSVersionTable.PSVersion.

  2. On Windows, script execution policy must be set to either RemoteSigned or Unrestricted. Check the script execution policy setting by executing Get-ExecutionPolicy. If the policy is not set to one of the two required values, run PowerShell as Administrator and execute Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm.

Installing PSDevtools via PowerShellGet on and Windows

PSDevtools is available on the PowerShell Gallery and can be installed using the PowerShellGet module.

  1. Start Windows PowerShell

  2. Execute one of the following two commands from an elevated PowerShell prompt, depending on whether (A) you've never installed PSDevtools, or (B) you've already installed a previous version:

    # (A) You've never installed PSDevtools from the PowerShell Gallery
    #
    # NOTE: If asked to trust packages from the PowerShell Gallery, answer yes to continue installation of PSDevtools
    # NOTE: If the AllowPrerelease parameter is not recognized, update your version of PowerShellGet to >= 1.6 e.g.
    #       Install-Module PowerShellGet -Scope CurrentUser -Force -AllowClobber
    
    PowerShellGet\Install-Module PSDevtools -Scope CurrentUser -AllowPrerelease -Force

    OR

    # (B) You've already installed a previous version of PSDevtools from the PowerShell Gallery
    PowerShellGet\Update-Module PSDevtools

Installing PSDevtools Manually

If you need to test/debug changes prior to contributing here, or would otherwise prefer to install PSDevtools without the aid of a package manager, you can execute Import-Module <path-to-src\PSDevtools.psd1>. For example, if you have git cloned PSDevtools to ~\git\PSDevtools you can import this version of PSDevtools by executing Import-Module ~\git\PSDevtools\src\PSDevtools.psd1.

Using PSDevtools

After you have installed PSDevtools, you can use the following functions.

Open-Solution

Provided you have associated .sln files with Visual Studio, you can run the command

Open-Solution

or its alias

sln

from within the directory containing the solution file, and the solution will be opened in Visual Studio.

Set-FileDates

This is supposed to be similar to the Unix command touch, albeit with less functionality. Used on an existing file, it updates the last access and last modifed dates. Used with the name of a file that doesn't exist, it creates an empty file with that name.

Set-FileDates filename.txt

or using the alias

touch filename.txt

About

Powershell module providing a few useful command line functions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published