Questions tagged [powershell]

Tag to be used for questions about Microsoft Powershell. For general shell questions, use the [shell] tag. For other shells, use their own tags like [bash] and [zsh]. For questions about scripting, the tag [scripting] should be used along with the shell tag.

PowerShell is a shell developed by Microsoft. Originally a part of Windows operating systems, it became open source on 18 August 2016. It's source code is available on GitHub with installation packages ready for, inter alia, Ubuntu, CentOS, OpenSUSE and macOS.

Related tags

Related links

39 questions
10
votes
1 answer

wget not saving file after download

So I am currently using the wget command on windows 10 powershell to download various files. However, when testing this command, files do not actually download. For example, say I want to download an image, say https://picsum.photos/200, I would use…
Tahoe155
  • 113
  • 1
  • 1
  • 6
8
votes
2 answers

Installing PowerShell on 32-bit Kali OS fails

I am having some issues installing PowerShell on my 32-bit Kali Linux PC.  I followed this guide and started with: apt update && apt -y install curl gnupg apt-transport-https Next, I downloaded and added the public repository GPG key so APT will…
WeAreOne
  • 129
  • 1
  • 1
  • 5
6
votes
3 answers

Resolve-DnsName : The term 'Resolve-DnsName' is not recognized as the name of a cmdlet

Why is Resolve-DnsName not recognized for PowerShell Core? So far as I recall it works fine with PowerShell itself. Is this a .NET versus dotnet problem? That dotnet simply doesn't have this functionality? thufir@dur:~/powershell/webservicex$…
Thufir
  • 1,810
  • 6
  • 33
  • 60
3
votes
0 answers

Opening powershell remote sessions in a loop in linux leaks memory

I am stuck with the following problem: we have an app that runs an continuous loop opening remote connection via powershell (performing some actions and then closing). This works fine in a Windows machine but not in Linux ones (tested on Ubuntu…
Veverke
  • 338
  • 3
  • 16
2
votes
2 answers

yt-dlp + mpv chained media playback

I've been using yt-dlp to download audio files before running mpv for playing them back. I've been specifically using the following commands: yt-dlp -f ba "ytsearch:major artist cool music" mpv [Title of the audio file downloaded].webm Now, what…
Gabe Devs
  • 43
  • 5
2
votes
2 answers

Do executable shebang scripts always require LF line endings?

On Stack Overflow a comment to Can PowerShell Core handle ps1 files with CRLF line endings in Linux environments? asserted that executable files that use a shebang must use only the LF line ending, based on a quote from an O'Reilly book. And…
Garret Wilson
  • 401
  • 4
  • 5
2
votes
3 answers

Would it be best for PowerShell scripts to also have a shebang?

Shell scripts are better when having a shebang like so: #!/bin/bash echo "The shebang above this line works like a typical a comment but with a purpose" PowerShell scripts are also shell scripts. So it should be okay to do like…
2
votes
1 answer

Is there an equivalent to PowerShell's "Switch" in bash?

I was curious as to whether or not there is an equivalent to PowerShell's "Switch" command that lets you maneuver with input instead of using a multitude of "if-statements"
Paco R.
  • 21
  • 1
2
votes
2 answers

`powershell -version` doesn't work on Linux

I have just installed the open-source version of PowerShell for Linux on Arch Linux using the powershell-git package from AUR. When I try PowerShell's -Version functionality, I get the following: PS /home/user> powershell -Version 5.1 …
1
vote
1 answer

How do I enable colours by default for common utilites in PowerShell on (Gentoo) Linux?

I'm currently running Gentoo Linux and have installed PowerShell (app-shells/pwsh-bin) as I am a contrarian. That being said, I am unable to obtain colour by default when running certain commands. Take ls or grep. When running ls or grep in a normal…
JJ Marr
  • 13
  • 3
1
vote
0 answers

Powershell (pwsh) user bug?

I'm on Fedora 33 + Gnome. Open gnome-terminal in a folder (let's say, the Downloads), open another terminal tab/window and type pwsh: if you check the value of $profile it refers to a temporary location. How can this be fixed? It seems a bug: if I…
1
vote
1 answer

Inserting into a Oracle table from a shell variable storing thousands of values

I'm trying to insert records into a column in Oracle where the values are passed from a shell variable. The variable itself stores pattern generated from a list of files. This pattern is generated on each iteration inside a for loop. The variable…
1
vote
0 answers

installing WSL Ubuntu: Add-AppxPackage fails, "The Visual Elements extension failed while processing the Notification element"

I want to install WSL 1 in my Win 10 OS, and have followed the instructions at https://docs.microsoft.com/en-us/windows/wsl/install-win10 from PowerShell as Admin: dism.exe ... - no problem installing Linux distro (Ubuntu 20.04) via Microsoft Store…
Colin Rowat
  • 111
  • 2
1
vote
1 answer

VMWARE create a Vm

I want create one template template from one modele with power cli. I have esxi 6.5 and vcsa 6.7 Plese can you help me
1
vote
0 answers

using powershell on Linux with Ansible

In looking at powershell, the general assumption is that it's being used either for or on Windows machines in a homogeneous network. Strictly within Linux, and only using "core" powershell, looking at automation: You are reading an unmaintained…
Thufir
  • 1,810
  • 6
  • 33
  • 60
1
2 3