Questions tagged [powershell-v6.0]

For issues related to the open source PowerShell 6.0

Resources:

  1. github project
  2. PowerShell Documentation
55 questions
1
vote
0 answers

Powershell Core "Couldn't resolve host name"

I'm using Powershell 6b5 AppImage on Arch Linux (using the official AppIimage). I have no trouble using IPv4 and IPv6 networking outside of powershell, both URL and IP. However, in PS, when I invoke the following command: iwr 'http://google.com',…
0fnt
  • 8,211
  • 9
  • 45
  • 62
0
votes
2 answers

Check/read registry key value on remote computer with local admin credential

How to check registry key value on computer which is not in domain?? I think that I must use local admin credential for this but I dont know how I tried this: $user = "admin" $password = "pass" | ConvertTo-SecureString -asPlainText -Force $computer…
0
votes
2 answers

PowerShell - Rename duplicate filenames in an object array

If I have some JSON like this: $inputJson = @" { "attachments" : [ { "name": "attachment.eml", "attachment_url": "https://www.attachment1.com" }, { …
user2363207
0
votes
1 answer

Problems with converting a string to timespan in order to sum a column imported from CSV

I want to import a CSV file with my working hours. Format is as follows: Description;Start Time;End Time;Duration;Day When I import the CSV, each object gets imported as string. I try to convert the colmn 'Duration' as [timespan] in order to sum…
0
votes
1 answer

How to convert XML based XLS file to XLSX?

I have a bunch of XLS files. On opening the file I got the prompt: format and extension don't match Later, I found out that this is an old XML based XLS file. For that reason I couldn't directly import those files into R or SAS. I tried opening one…
jw0ng
  • 91
  • 4
  • 11
0
votes
2 answers

Powershell + 7zip to batch extract and rename - getting "No files to process" message

Edited: Originally, my question was why the first piece of code wont work. the unzip action was working if I run it on it own on on single file outside the loop. but once I wrapped it round with loop, it won't work, and there was no red error…
jw0ng
  • 91
  • 4
  • 11
0
votes
0 answers

How to grant permission to AAD native app in PowerShell 6?

I registered a native application on Azure Active Directory via powershell 6 (module AzureAD.Standard.Preview) and I need to grant the permissions with powershell 6 code (Settings > Required permissions> Grant permissions). I'm using the AZ…
0
votes
3 answers

Powershell bigint output differ from declared value

I'm porting lesspass password manager to powershell, but I'm having trouble when implementing the _consume_entropy() method, especially the Python divmod. Reproduce PS> [bigint]$EntropyAsInt =…
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
0
votes
1 answer

How to Calculate Total Number of Memory in Azure VM's

I have Azure account and I need to know how much memory is installed in all the VM's. For number of Cores, I use below command. >Get-AzureRmVMUsage -Location WestUS But how can I get the Memory details?
0
votes
2 answers

Trying to combine data into a single line

I work for a company that has a few web servers that is load-balanced. I've created a PowerShell script that goes against all our IIS servers and pulls the 500 error entries and then pulls the clients IP address' and shows me a count of how many…
Reuben deVries
  • 127
  • 1
  • 7
0
votes
1 answer

How to copy string to clipboard Powershell? Linux/Windows/Mac

I'm in the process of writing a powershell module, that aim to be distributed and I'm looking for a cross-platform (Win/Linux/MacOS) powershell ≥5.0 solution to copy a generated string to the system's clipboard. Env > $PSVersionTable Name …
0
votes
1 answer

Load a PowerShell module for debugging when starting Visual Studio for Mac

I'm using Visual Studio for Mac (7.7.2; build 21) to create a PowerShell provider using C#. I'd like to have the IDE load PowerShell for debugging. The project's run configuration: Start external project: /usr/local/bin/pwsh Arguments: -NoProfile…
craig
  • 25,664
  • 27
  • 119
  • 205
0
votes
2 answers

Powershell merge 2 columns from different files without a key field

I have 2 csv files and have file1.column1, file1.column2, file2.column1, file2.column2. I would like to have out put like below File1: Column1, Column2 1,a 2,b 3,c File2: Column1, Column2 x, abc y, def z, ghi Output I am expecting…
0
votes
1 answer

Get-Item and setting Content-Type before upload

I've been trying to build out some code in PowerShell (PowerShell 6 Core works, the following code didn't work in PowerShell 5), $Token = ' Token Here '; $Headers = @{ Method = 'POST' Uri = ' URL Here ' Headers = @{Authorization =…
0
votes
1 answer

How do I create function that runs a command?

So what I'm trying to do is recreate a similar function as I would use in Bash, but in Powershell: yell() { echo "$0: $*" >&2; } die() { yell "$*"; exit 111; } try() { "$@" || die "FAILED: $*"; } The part that I'm most interested at the moment is…
Sinaesthetic
  • 11,426
  • 28
  • 107
  • 176