linux
5 TopicsPowerShell support on Linux
I am trying to invoke Powershell 7.4 on Linux RHEL8 through a java program and submitting commands and reading output using streams. As soon as the powershell starts , the inputstream is reading some unknown characters from the powershell output for e.g. '[?1h' and '[?1l'. I need a way such that I don't read these characters. I tried setting the encoding in the input stream to UTF-8, but that didn't solve the problem. Would really appreciate if someone could provide some inputs on this.554Views0likes2CommentsC# + PowerShell + Linux AKS - Cmdlet results in failure, but action executed
Our code is in C# and we use .NET7 & PowerShell SDK 7.3.6 & have this application deployed in AKS. The Docker image is based on aspnet:7.0-apline image with PowerShell 7 installed & PSWSMan, WSMan and ExchangeOnlineManagement (v3) modules installed. We use an enterprise application connecting to Exchange Online via certificate authentication. We limit the commands to retrieve into the PowerShell session to New-Mailbox cmdlet only. Each command gets its own PS session reusing previously constructed runspace. When we try to restore a previously deleted mailbox, we occasionally receive PSRemotingTransportException. The details we observe there are: ErrorCode: 2101 CategoryInfo.Category: ResourceUnavailable CategoryInfo.Reason: ParentContainsErrorRecordException Exception message: The background process closed or ended abnormally: \n Exit code: 137\n Stdout: ''\n Stderr: ''\n . When we execute this with multiple users at the same time (15 users, ~3 in parallel) - we receive such error 1-3 times out of whole batch of 15 mailboxes. The issue is not on failure - because we can handle it. The main problem is that those users/mailboxes are actually (almost always) created, but the PowerShell connection is "interrupted" or something indicating there was an error and we need to go through additional steps. Has anyone observed anything similar? Is there any reason for such error on our side? Is there anything we could try to get this more robust? Does anyone an idea on what the 2101 error stands for?Solved888Views0likes2CommentsPowerShell in BASH for Windows 10
So, you have a Windows 10 Pro (or higher) but somehow don't have a way to build a linux virtual machine. In windows 10 (build 14393) you can install the Ubuntu Linux subsytem Bash in your machine. Currently, if you install PowerShell Open Source in Bash, it won't work. But there's a workaround you can use to make it functional enough to create and run scripts and, at the same time learn about Linux, Check my blog post on it: http://www.maxtblog.com/2016/10/running-powershell-in-windows-10-bash-workaround/1.7KViews2likes0Comments