Tags "powershell-core" Result

PowerShell remoting: Controlling what edition is being targeted (PowerShell Core or Windows PowerShell); the state of cross-platform remoting

This self-answered question, which focuses on Windows[1], addresses the following aspects: Now that there are two PowerShell editions - the legacy, Windows-only Windows PowerShell and the cross-platform PowerShell Core, both may be installed on a given Windows machine: How can I tell which PowerShell edition will execute remote commands, such as

it1352 6 2020-07-03

Using both desktop Powershell 5.1 and Powershell Core 6.1

I was playing with PS.Core 6.1 in my VS Code - made it the default shell, opened PS debugging sessions with it, opened its console, etc ... Now I am opening the regular desktop Powershell 5.1 and get this: Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS C:\Users\me> get-module ModuleType Version Name

it1352 0 2020-07-03

Invoke-Sqlcmd cmlet missing in Powershell core sqlserver module for linux

I am using latest version of Powershell core on Linux Ubuntu 16.04. I am trying to query a sql server database using powershell's invoke-sqlcmd cmdlet. (Yes I have installed the sqlserver module) I get an error which says that it cannot find the cmdlet. The command is there in windows powershell when I install the sqlserver module. Screenshot of th

it1352 1 2020-07-03

How to use Windows System.Speech for TTS in PowerShell 7 (or is there an alternative)

I have the same profile.ps1 in both WindowsPowerShell and PowerShell. It includes commands that invoke Windows Text-To-Speech However, these commands fail when run in PowerShell 7. The errors occur when I try to use the $PomrptTTS object I create with the following code: Add-Type -AssemblyName System.speech $PromptTTS = New-Object System.Speech.

it1352 3 2020-07-03

Is it possible to redirect output to a file using the redirection operator without writing a byte-order mark in Powershell?

Is there any way to omit the byte-order mark when redirecting the output stream to a file? For example, if I want to take the contents of an XML file and replace a string with a new value, I need to do create a new encoding and write the new output to a file like the following which is rather ham-handed: $newContent = ( Get-Content .\settings.xml

it1352 0 2020-11-05

Where to handle AssemblyResolve event in a class library?

I need to dynamically resolve assembly references from one class library to another. The class libraries are being loaded from a PowerShell script, so the default .NET behaviour of looking for dependent assemblies in the executable directly fails, as the executable is PowerShell itself. How do I make these dependent assembly references resolve / wo

it1352 1 2019-05-15