Setting up 1-click Install for custom Powershell provider - powershell

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:
configure Powershell to run against .Net 4 (add a config file in c:\Windows\System32\WindowsPowerShell\v1.0)
add a custom formatter (to the System32 for c:\Windows\System32\WindowsPowerShell\v1.0).
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?

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?

Related

How to locally debug a Queue triggered Azure Function wirtten in PowerShell with Visual Studio Code?

I would like to have some information about how to do such a thing.
I've installed the plugins for Visual Studio Code, I've imported the modules at the beginning of my PowerShell script, I've fill the requirements.psd1 with the appropriate module names.
Still, when I launch the command, nothing happen.
My goal is to create a team in Microsoft Teams using PowerShell.
I put a breakpoint and it is never reached.
What am I doing wrong ?
Thank you.
Summarize the comments above as below for other communities reference:
Just wait for some minutes until the powershell terminal displays some relevent information. Otherwise that means it is importing/installing modules. We can also refer to the post provided by Mathias in the comments.

Deploy an asp.net package, sql databases and modify (text-)files

we are currently using a powershell script (~800 lines of code) to deploy an asp.net website, setting up the databases and modifying some xml nodes / text files. Can we use the wix toolset to do that? I am not very familiar with it. Or is it possible to copy our installation folder to the target system and executing the powershell file on it, using the wix toolset?
Yes, WIX can handle this.
You can start with this tutorial that includes enabling feature in IIS, installing website and change config files.
Just had a similar question / problem. My problem was that I couldn't get a powershell script working. I wrote a guide over here that migth help you. Feel free to ask if you need further assistance! :)

Is there a way to check out a file under a different username using tfs powershell snapin?

I'd like to checkout a file under a different username using powershell's tfs snapin. Except, I don't see a login or user switch when I lookup Add-TfsPendingChange.
Is there a way of doing this?
I'd rather not switch between the snapin and the cmd line versions if possible. Shouldn't need to do that anyway.
TFS power-shell snapin use the credential which is entered when create the workspace and only provide basic version control commands feature. Call "tf.exe" in powershell script directly would be an easy way to achieve the feature you want. If you don't like this method, you can involve TFS API in your powershell script. Refer to "Beyond the basics" in this link for details: PowerShell and TFS: The Basics and Beyond.

Opening an existing TFS query via powershell/nuget console

How would one go about opening an existing TFS query using powershell, more specifically the nuget console in VS (2013)?
I have to open several queries each time I open VS, and it would make life much easier to do so via a simple powershell cmdlet.
Thanks!
-k
Please check the post here which uses tfpt.exe inside powershell scripts to run the TFS queries.

How to get Annotation from TFS using PowerShell?

This document describes how to get the Annotation of a file from TFS: http://msdn.microsoft.com/en-us/library/bb385979.aspx
I am interested in obtaining the Annotation of a file using PowerShell. Any ideas if this is possible and if so, how one would go about doing it?
Since you can run normal MSDOS commands in PowerShell, I'd recomment installing the Team Foundation PowerTools from:
For 2008:
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&displaylang=en
For 2010:
http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
Using "tfpt annotate" and parsing the output.
Grant Holiday talks about automating the process here is you want to pass the whuffie on:
TFS annotate/blame summary report for a project
PsTFS from Codeplex is a set of PowerShell commands to manage and use Team Foundation Server. May it help I don't test it.