Questions tagged [powershell]

Apply this tag to questions related to any version of PowerShell.

Filter by
Sorted by
Tagged with
2
votes
1answer
141 views

How to convert a powershell script to opensource `.exe`?

To make an installation of opensource software for the Windows platform single click, I am trying to convert the setup.ps1 into a setup.exe file. (To make a powershell script executable in a single (...
2
votes
1answer
107 views

Custom object formatting caveats as to not confuse end users

Default display of objects in the Windows PowerShell console In PowerShell you have format.ps1xml documents. These are used to simplify what and how object data is shown to the end user. A simple ...
0
votes
0answers
46 views

Typical Practice for external application config

I have a C# cmdlet(1) that uses "ConfigurationManager.AppSettings" to get database connection strings necessary for some stored procedures used in the cmdlet(1). If another application instantiates an ...
7
votes
2answers
11k views

Correct way to initialize variables in PowerShell

Is there a preferred practice around initialising variables which are first defined within a branch of code, or is this purely subjective / personal preference? i.e. there are multiple ways this can ...
1
vote
0answers
86 views

Continous integration of only MyCompanies nuget packages

I am trying to do a nightly package integration with one of our projects that consumes 6 other internal teams’ -PreRelease packages. Background Info We have our own internal ProGet Server that ...
-1
votes
1answer
247 views

How to license (PowerShell) GUI Projects [duplicate]

After almost 2 years learning how to code (in Powershell) and some help at Stackoverflow from time to time, I'm now finally on my way to release my first GUI project. I intend to release the compiled ...
1
vote
1answer
227 views

Should Write-Debug statements be left in production PowerShell code?

This is one of my functions I have in a module: Function Get-DatabaseUser { [CmdletBinding()] Param() Write-Verbose 'Getting database...' $Database = Get-Database Write-Debug('...
0
votes
1answer
127 views

Unix way of filtering/mapping/mapcatting records via the pipeline?

At home I use Linux and have for more than a decade. At work we use Windows and so I find PowerShell more familiar. I am a Linux/Unix fanboy at heart, but I've had greater success grokking the ...
5
votes
1answer
173 views

How is Pash licensed?

Pash is an open source reimplementation of Windows PowerShell. It was released in 2008, and has been idle since then. I would like to take up the mantle. It's not clear what the license is. There is ...
0
votes
1answer
3k views

Multiple files in powershell [closed]

How to using multiple files in Powershell to ensure modularity? function.ps1 could have all the utility functions? command1.ps1 could have calls related to a command?
18
votes
5answers
3k views

Are there well-known PowerShell coding conventions?

Are there any well-defined conventions when programming in PowerShell? For example, in scripts which are to be maintained long-term, do we need to: Use the real cmdlet name or alias? Specify the ...