0

I've created a custom Powershell provider. However, currently there are a few steps people have to do to get it working on a user's computer:

  1. configure Powershell to run against .Net 4 (add a config file in c:\Windows\System32\WindowsPowerShell\v1.0)
  2. add a custom formatter (to the System32 for c:\Windows\System32\WindowsPowerShell\v1.0).
  3. register the snap-in.

The remainder setup steps are completed by a custom powershell script.

I was wondering if anyone could share their experiences on simplifying the process. Ideally I'd like people to run from a single command (ideally a CommandLet that's completes all the above steps.

Has anyone got any Links or Suggestions or Best Practise they could share?

penderi
  • 8,673
  • 5
  • 45
  • 62
zidsal
  • 577
  • 1
  • 7
  • 30
  • I've edited to make it a little clearer what you're asking - essentially Best Practise for deploying Powershell extensions AND THEIR FORMATTERS etc. For my two-penn'th I'd recommend checking the source of existing Powershell scripts, particularly PSCX (community extensions) that will already be easy to install and come with pre-canned formatters. – penderi Aug 28 '12 at 11:28

1 Answers1

1

I've found the following snippets that may help.

VS Command prompt variables

For the Visual Studio Command you could try Lee Holmes' http://poshcode.org/2176 or the Powershell Communit extensions (PSCVX). Both from https://superuser.com/questions/104868/run-visual-studio-command-line-tools-in-windows-powershell.

After that it's just the formatter and/or registering the snap-in.

Configure Powershell to use .Net4

How can I run PowerShell with the .NET 4 runtime?

Community
  • 1
  • 1
penderi
  • 8,673
  • 5
  • 45
  • 62