Anyone know how I can get a build of Windows with Powershell 2.0 running in a Docker container for testing? I've looked at all the official images from MS and none of them seem to have support for it. I have a client I'm helping with getting away from their old machines, but I have to write some scripts that will be run in the old environment (PS 2.0).
I don't know about specific Docker image, but you can use Powershell 2.0 simply by running powershell.exe -version 2 with latest Windows 10 for example.
Reference.
Found a link to a Windows Server image with Net Framework 3 installed, which has Powershell v2 included. Using the command from #Niklas above, I now have a working Powershell v2.0 environment for testing! See below for the docker image link.
https://stackoverflow.com/a/59525183/5445457
Related
I have a Windows Server 2012 R2 where I installed Jenkins.
I want to run some tests that execute Swift code for our iOS app in a Jenkins pipeline.
First of all, is it possible to run such tests, since Jenkins is installed on a Windows server?
Second, is there any Jenkins plugin I can use to perform such task?
Do you know of any documentation or tutorial?
I have not been able to find anything relevant on the Internet.
Thank you very much
cghersi
It’s possible to run Swift on windows, but to run all your iOS app’s tests (which invariably will depend on iOS specific frameworks like UIKit or SwiftUI) is only possible via the Xcode tool chain on macOS.
I use the powershell New-AzureRmIntegrationAccountSchema to deploy a schema to an integration account.
It worked in the past but now I have this error :
Unable to deserialize the response.
Unfortunately I don't have more details on the issue.
Any ideas?
I set the PowerShell version to 2.1.0 in the Release Pipeline and now it works :)
For your issue, I suggest you could test your xml file on Azure Portal to know whether this is a Power Shell issue or your xml issue.
If your xml works fine on Azure Portal. You could check your Azure Power Shell version with following cmdlet.
Get-Module -ListAvailable -Name Azure -Refresh
I test on 4.4.1 version, it works for me. You could download the msi installer from the link.
If it also does not work, you could add $DebugPreference="Continue" to print more debug log.
Update:
It is a Power Shell version issue, OP use older version Power Shell, when set the Power Shell version to 2.1.0, the issue is resolved. I test in my lab, if we use the latest version, the cmdlet also works.
I'm having trouble with installing PowerShell 5 on Windows Server 2012 R2 using Packer.
To install PowerShell 5.1, I'm using chocolatey
powershell
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
choco install PowerShell -y
I need to to do this for two packer builder:
Amazon Web Services EC2 AMI.
Hyper-V Vagrant.
With the Amazon Web Services EC2 AMI I've tried executing the above from the following locations
As part of the user_data_file script.
As an inline provision script.
I've added the windows-restart provision in the flow after the execution of the fragment.
Similarly I've tried the same with the Hyper-V Vagrant both as part of the Autounattend flow and as an inline provision.
In both cases the installation fails because the user profile is not created. At least I think that is the problem. As a reference, I've faced the exact same problem when installing sql server express.
Has anyone managed to accomplish this flow and what is your recommendation?
PowerShell package uses MSU (Windows Update file). There are a couple of considerations here:
Ensure Windows Updates Service is turned on. Chocolatey doesn't do that yet, although there is an issue filed.
MSUs must be run locally from the machine. So if you are running over WinRM, you instead need to have it set up a scheduled task to call choco install and then run it that way.
Yes, that second point is accurate. No, it is not Chocolatey's fault. That's a Microsoft design decision with MSU files. It's a real PITA.
FYI - BoxStarter handles it appropriately, and it can be used with Packer. You will find less pain if you look there.
HTH
I have developed an application in Lightswitch 2012, and now need to deploy it to a desktop PC running XP SP3.
I have already looked at two previous posts Can't run Lightswitch 2012 Programm under Windows XP and
Lightswitch Desktop Application Wont Install in XP SP3
The two posts both refer to executing [editbin vslshost.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1] to modify the vslshost.exe file, though only the first post says it worked.
In my case, I have tried the above to update the vslshost.exe file, but when I publish my LS2012 project it reverts back to the default vslshost.exe file. And if I manually swap the file with the copy I modified, when I run the deployed app I get the following error:
System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, vslshost.exe, has a different computed hash than specified in manifest.
- Source: System.Deployment
So, the questions are
am I doing something wrong?
is there a master copy of vslshost.exe I need to update instead?
(BTW, I also ran the VS2012 (KB270250 from VS2012 Update 1 CTP 4))
Thanks for your help
As this is an internal company app, I have just convinced our IT guy to upgrade the machine, because the certain grief of trying the different possible solutions was just too much.
BUT if you MUST deploy to XP
To find out more, here are two pretty exhaustive posts with input directly from the Lightswitch team:
Progress on LS2012 desktop apps installing AND running on XP yet?
Windows XP 32 bit deployment
Enjoy....(???)
Looking to use Powershell for writing some scripts. The concern is, do all users of the script need Powershell installed on their computer in order to have the script execute properly? Is the behavior different for Windows 7 vs. XP vs. 2k etc? I understand powershell is included in 8, so that's not a concern.
PowerShell is also included in Windows 7. PowerShell might be included in XP not sure on that. I'm pretty sure 2k does not have PowerShell. Yes, if you want to run a PowerShell script you will need to have PowerShell installed. Just like you would need Python installed if you want to run a Python script.
I know that Win 7 comes with PS version 2.0 by default. Not sure on XP. The current version is PS is 3.0 it comes with the Windows Management Framework (WMF) 3.0.
During December 2012 Microsoft had the WMF 3.0 deployed as an update but recalled it a couple of weeks later because there was some compatibly errors with other stuff.
I'm using PS 3.0 and updating all my computers to PS 3.0. PS add new stuff that I want to learn.