Questions tagged [powershell]

Relates to Microsoft PowerShell for Ubuntu.

Filter by
Sorted by
Tagged with
0
votes
1answer
952 views

*Error Permission denied (publickey)* Does Windows 10 Powershell Support OpenSSH Public Keys with Ubuntu 20.04

Yes I know this a Ubuntu forum.. First off all thanks for doing what you do and helping people! Alright so I've been trying to setup SSH keys on my Ubuntu 20.04, read stuff about it online. So I ...
0
votes
1answer
75 views

How to launch nano from within a PowerShell session?

How is nano launched from within the PowerShell console? Just looking for a simple way to edit a text file without switching a GUI or bash. bash -c "nano filename.txt" was unusable. ...
-1
votes
1answer
46 views

How to configure the PowerShell prompt on Ubuntu?

How do I configure the PowerShell profile so that the prompt is changed? nicholas@mordor:~/.config$ nicholas@mordor:~/.config$ ls -alh total 108K drwxr-xr-x 23 nicholas nicholas 4.0K Feb 4 19:50 . ...
0
votes
0answers
14 views

can not launch desktop icon for powershell using snapd on KDE

when i try to launch Powershell from the .desktop icon created from installing using snap on the KDE environment, i get this message "Terminal cool not found while trying to run /var/lib/snapd/...
0
votes
1answer
145 views

How to stop the bash script when a command meets an error?

I need the below bash script to do the following that when the gcc command returns an error, the script will stop looping and exit prematurely. And if the script is exiting prematurely it should ...
2
votes
1answer
350 views

Why is Vagrant in Ubuntu Docker container on Windows looking for PowerShell?

I am taking some training where all of the examples are in Ubuntu, but I am on Windows. So I thought I would install an Ubuntu Docker container, and that went well. The examples also require ...
0
votes
1answer
253 views

Combine two files and aggregate another column

I'm trying to compare two files, on basis of the id column, A.txt contains ID, NAME fields. B.csv contains ID, NAME, PLACE, DATE, I want find which month had most of the ID's from a.txt I'm trying to ...
7
votes
3answers
3k views

How to install PowerShell 7 on Ubuntu 20.04?

I am having trouble installing PowerShell 7 on Ubuntu 20.04. I used Ubuntu Software to install powershell 7.0.3, which is the latest/stable version available. After an error-free installation, I ...
1
vote
2answers
624 views

Create and append key value pairs to a file of JSON objects with a regex of each JSON object value

I have a big file that contains json objects each object in a new line. File example {"Name" :"%Hana-29-Mrs-Smith","job":"engineer"} {"Name" :"%...
0
votes
0answers
223 views

Remote desktop access enabling from terminal in Powershell

I am accessing my Ubuntu 19 workstation from my Win 10 home computer through Powershell. My remote desktop is not enabled in Ubuntu and I can't access remmina or anything that requires GUI like xRDP ...
1
vote
3answers
116 views

Move 10 digit number to the beginning of file name

I have thousands of files that I need to rename. They all contain a 10 digit number that all begin with '42469'. I need to move this 10 digit in each of the files to the beginning of the filename ...
0
votes
0answers
362 views

add bash script to /etc/profile.d/ to load variables?

As a follow-on to a bash question on setting environment variables, I see: /etc/profile.d/*.sh Files with the .sh extension in the /etc/profile.d directory get executed whenever a bash login shell ...
2
votes
1answer
854 views

How to set environment variables from within powershell?

How do I make foo an environment variable accessible through printenv on bash? PS /home/thufir/powershell/helloPSTwitterAPI> PS /home/thufir/powershell/helloPSTwitterAPI> $env:foo = 'x' * 333 +...
0
votes
1answer
968 views

Post installation of PowerShell - PWSH command not found

I have just installed PowerShell on my Ubuntu server (18.04) using the command dotnet tool install --global PowerShell. After completing the installation sequence I was presented with You can invoke ...
1
vote
1answer
552 views

PowerShell not working in Ubuntu 19.10

I use Ubuntu version: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 19.10 Release: 19.10 Codename: eoan PowerShell Version: latest/stable 6.2.3, source: snap store;...
1
vote
1answer
46 views

Change characters to lowercase

I am trying to make all values in the 11th column of my .csv file lowercase. I know I can use 'tr A-Z a-z' but how do I make sure it is working in the file I want and only on the 11th column.
0
votes
1answer
295 views

Accessing MySQL from Powershell on Ubuntu 18

I'm trying to access MySQL via PowerShell running on Ubuntu 18 and having some trouble loading the Assembly. Below is the code as it runs on Windows. [void][System.Reflection.Assembly]::...
-1
votes
2answers
2k views

Copying first 100 files from multiple folders to one folder (or deleting the rest)

I've got the following issue. I've got a folder, within this folder there are about 100 different folders, within each of these folders there are about 500 files. I want to only keep the first 100 ...
2
votes
1answer
2k views

Set Powershell as login shell in Ubuntu 19.04

In Ubuntu 19.04 sudo apt install powershell fails with The following packages have unmet dependencies: powershell : Depends: libssl1.0.0 but it is not installable Depends: libicu60 but ...
-1
votes
2answers
1k views

Convert String to time using shell

I have shell script which will bring time (h:m:s)from database and compare that time with the current time to make an action depending on the result of comparing . I get current time using this ...
4
votes
1answer
2k views

How to make PowerShell Core remoting work?

I have Kubuntu 18.04 installed on my machine and I installed PowerShell Core following the instructions given: Installing PowerShell core in linux. I then setup the remoting following the steps ...
1
vote
0answers
347 views

Exporting environment variable not working from shell script

I have ubuntu image in docker, I'm trying to setup nodejs, phantomjs, npm etc.. and for PhantomJS I need to export QT_QPA_PLATFORM variable and set it's value to offscreen. The problem is that when ...
1
vote
0answers
2k views

Get-LocalUser in powershell fails with “The term 'Get-LocalUser' is not recognized”

I have installed both powershell binary and app image and get the same error in both. PSVersion: PSVersion 6.1.0-preview.1 PSEdition Core ...
0
votes
1answer
311 views

Setting up the AWS Tools for PowerShell Core on Linux

The AWS utility has this to say about privileges: Note Although you can start PowerShell by running sudo pwsh to run PowerShell with elevated rights, be aware that this is a potential ...
2
votes
0answers
414 views

Powershell constantly creates folder in /tmp

System: Ubuntu Server 14.04.1 uname -a Linux [...] 4.4.0-116-generic #140~14.04.1-Ubuntu SMP Fri Feb 16 09:25:20 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Involved Software: nagios (core Version 3.5.1)...
-2
votes
1answer
3k views

execute a powershell script (hello world)

A powershell "hello world" script is spawning and bogging down the system: Tasks: 413 total, 2 running, 411 sleeping, 0 stopped, 0 zombie %Cpu(s): 42.8 us, 5.9 sy, 0.0 ni, 51.2 id, 0.2 wa, ...
-1
votes
1answer
1k views

How to install powershell on Artful Aardvark 17.10?

Because of this bug it's not possible to install powershell from apt for newer Ubuntu versions? $ cat /etc/apt/sources.list.d/microsoft.list deb [arch=amd64] https://packages.microsoft.com/ubuntu/14....
1
vote
1answer
2k views

Changing the terminal font colors while running linux(ubuntu) in Windows PowerShell?

I'm running ubuntu through the Windows PowerShell. The path is in a blue color which is very difficult to read. How can the colors of the fonts, backgrounds, foregrounds be changed?
3
votes
1answer
710 views

How to install software to another partition?

I dont have enough free space on my ubuntu partition(200MB free space to be precise) and but I want to install Android studio and powershell. I have 7-8GB free space on my other three partitions.How ...
12
votes
4answers
11k views

Install Powershell in Ubuntu 17.04

I'm trying to install Powershell in Ubuntu 17.04 as the following these steps: curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - curl https://packages.microsoft.com/config/...
1
vote
0answers
557 views

PowerShell launcher

I am setting up a demo Ubuntu 16.04 devbox and I wanted to create a launcher entry for PowerShell that uses the default gnome-terminal but with the canonical PowerShell colors and icon on the launcher....
19
votes
4answers
7k views

How do I install PowerShell?

Not long ago I read something on Microsoft's website about PowerShell being available for Ubuntu. How would I go about the install of PowerShell? I'd appreciate guidance for both Xenial & ...
4
votes
3answers
15k views

Can I run PowerShell on Ubuntu? [duplicate]

I have been assigned a project to be done in Windows PowerShell. I am familiar with shell scripting but it's a new technology. I was told that its similar to shell except few syntax changes. I have ...