PSDeploy | Simple PowerShell based deployments | Continuous Deployment library
kandi X-RAY | PSDeploy Summary
kandi X-RAY | PSDeploy Summary
PSDeploy is a quick and dirty module to simplify PowerShell based deployments. The idea is that you write a *.psdeploy.ps1 deployment configuration with sources and targets, and PSDeploy will deploy these. Suggestions, pull requests, and other contributions would be more than welcome! See the [contributing guidlines] Contributing.md) for more info.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PSDeploy
PSDeploy Key Features
PSDeploy Examples and Code Snippets
Community Discussions
Trending Discussions on PSDeploy
QUESTION
Problem:
I am unable to successfully publish a non-monolithic script module to my local PowerShell Gallery when using PowerShell 5.1 and my module contains 7 or more functions. Publishes fine with 6 or less functions.
Example: FunctionsToExport = 'Get-Test1', 'Get-Test2 ', 'Get-Test3', 'Get-Test4', 'Get-Test5', 'Get-Test6', 'Get-Test7'
The publish always hangs at 'VERBOSE: Performing the operation "Publish-Module" on target…', but never completes.
I am not seeing any errors, so I am not sure why it is hanging.
What does work:
I can successfully publish my non-monolithic script module to my local PowerShell Gallery when it contains 6 or less functions.
Example: FunctionsToExport = 'Get-Test1', 'Get-Test2 ', 'Get-Test3', 'Get-Test4', 'Get-Test5', 'Get-Test6'
This works fine: VERBOSE: Successfully published module…
If I simply add one more function and update the manifest, I can no longer publish without it hanging again at the same place.
I am pretty sure I am missing a step, but I am having trouble figuring out what I missed.
I am learning the non-monolithic script module design from Mike F Robbins by reading his blog posts and watching his presentations. The gist of this design is each function is in a separate PS1 file that is dot sourced from the PSM1 file.
Summary of how I build my script modules:
- Create new script module scaffolding using custom Plaster template.
- Add functions to the folder named Public.
- Update module version and FunctionsToExport section in manifest.
- Use PsDeploy or Publish-Module to deploy to a local PowerShell Gallery.
- The local PowerShell Gallery is just a folder on my data drive G:\JnPowerShellGallery.
This is how I am publishing my module to my local PSGallery.
...ANSWER
Answered 2019-May-27 at 23:40Ok, I just found out I can publish my module successfully using PowerShell Core 6.2.0!
Joel on http://slack.poshcode.org/ powershell-help channel suggested to change the .psd1 file encoding to UTF8 with BOM. He said PowerShell 5 doesn't like .psd1 files that don't have BOM. They are encoded with UTF8 by default in vscode. I did try changing the encoding, but this did not fix my problem.
Thanks to his suggestion, I thought of trying to publish my module with PowerShell Core 6.2.0 and it worked!
This does not exactly solve the problem with PowerShell 5.1, but I don't mind switching to PowerShell Core 6.2.0 to publish my modules. This solves my problem.
QUESTION
I implemented a bunch of infrastructure checks (PowerShell scripts) that need to be ran on Window Servers (most of them use Get-WmiObject
cmdlet). I put them along with their Pester tests on GitLab and trying to build a pipeline.
I have read creating-your-first-windows-container-with-docker-for-windows and building-a-simple-release-pipeline-in-powershell-using-psake-pester-and-psdeploy but I am very confused. My understanding is that to have the code run on GitLab CI, I will need to build a Windows Server docker image?
the following is my .gitlab-ci.yml
file but it has authentication errors, the image can be found here:
ANSWER
Answered 2019-Apr-15 at 07:33ltsc2019
is one tag of the mcr.microsoft.com/windows/servercore
.
You need to refer this image at the beginning of your .gitlab-ci.yml :
image: mcr.microsoft.com/windows/servercore:ltsc2019
QUESTION
I have a group of interdependent .ps1 scripts I want to run in Azure (trying to set up continuous deployment with git, Pester unit tests, etc., as outlined in this blog). How can I run these scripts in azure without needing to manage a server on which those scripts can run? E.g., can I put them in a storage account and execute them there, or do something similar?
Using an Azure automation account/runbook seems to be limited to a single script per runbook (granted, you can use modules, which is insufficient in my case).
Note that I need to use PowerShell version 5+ (I noticed Azure web apps and functions only have 4.x.)
Thanks in advance!
...ANSWER
Answered 2017-Aug-11 at 02:08You were on the right track with Azure Functions. However, given that you need v5+ of PowerShell, you may want to look at Azure Container Instances (ACI) instead. It's a little different approach (via containers), but should not impose any limitations and will free you from having to manage a virtual machine.
Note: At this time ACI is in preview. Documentation is available here.
There is a PowerShell container image available on Docker Hub that you could start with. To execute multiple scripts in the container, you can override CMD in the docker file.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PSDeploy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page