Questions tagged [powershell-5.1]

280 questions
0
votes
2 answers

run a cmd command from powershell script

I am trying to run a program called Graphviz in the later stage of a PowerShell script I have to collect and create employee information to make an orgchart script located here in windows command prompt (cmd) it would be executed as like this Create…
Crash893
  • 11,428
  • 21
  • 88
  • 123
0
votes
0 answers

Powershell translated to Python

I am a newbie with Python, coming from an extensive C# and Powershell background. I am having trouble with figuring out how to do the following in Python: $bodyLines = ( "--$boundary", "Content-Disposition: form-data; name=`"insert`"$LF", …
Gurthang99
  • 29
  • 5
0
votes
1 answer

Windows PowerShell - Microsoft.Powershell.Commands.Utility not found

I first discovered that PowerShell is not working correctly when I open my VisualStudio 2019. The Package Manager Console was not working as you can see below: `Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Utility because of the…
0
votes
0 answers

How to pass an array of strings inside an Invoke-Command to a remote computer?

I have been stumped on this for today. I have a script that deletes remote user profiles by providing a computername to it, and it will make a listing out of the folders in C:\users to choose from based off their ADUC name. What I'm having trouble…
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
0 answers

How can I invoke multiple Robocopy.exe commands AsJobs?

Don't beat me up to much guys, I was trying to understand the other similair questions asked about this issue, just wasn't able to decipher them. I'm using the below code snipet to copy folders, seperately, on a "remote" computer using…
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
1 answer

Mysterious blank space randomly appears in Powershell console buffer

I am plagued by a very strange phenomenon. I tend to write fairly esoteric Powershell modules for stuff I do at work. Often, after running one of these, and the module has ended I will move onto some other tasks, and when I happen to bring up my…
mmseng
  • 735
  • 9
  • 24
0
votes
0 answers

create .json file with encoding UTF-8 using powershell script

I am creating input.json file and i am able to do it but the problem is : this input.json has been created in UCS-E2 BOM encoding format. I think, it is by default encoding format. but i need this in encoding utf format becuase i am getting error…
Ashish Goyanka
  • 207
  • 3
  • 11
0
votes
1 answer

No parallelization despite the use of a runspace pool with powershell 5.1

We are working on a Powershell script that, among other things, performs a job import of multiple computers via a REST API. The normal job import also works flawlessly and gets an XML with all necessary information passed as parameter. Now we want…
0
votes
1 answer

Powershell: How to reference the columns in a select

I'm using PowerShell 5.1 to iterate through a list of computers from active directory, and I'm struggling with something that should be simple. In the code below, I'm selecting the name and description for each computer in a foreach loop. How should…
Brien Malone
  • 605
  • 1
  • 9
  • 20
0
votes
2 answers

Invoke-Expression - write output to console but dont return it from function

I want to call Invoke-Expression inside a function and print the output of the command to the console but don't return it from the function since I want to return a specific value from it. function Foo { $command = 'mvn clean package…
David
  • 1,672
  • 2
  • 13
  • 32
0
votes
2 answers

Get-Content .csv and use that as a variable for a path name

I am trying to use Get-Content and create a variable that will fill out a directory pathname based on each line of my file. I have a long list of users in a .csv file and I want to check each of their usernames to get directory size. The script…
izz
  • 15
  • 4
0
votes
1 answer

Configure application access policy with microsoft teams error exception calling "GetRemoteNewCsOnlineSession"

Am new to powershell and using this procedure to set application policy with microsoft team The above is necessary when creating online meetings as per this procedure but whenever i run Grant-CsApplicationAccessPolicy -PolicyName Test-policy…
Geoff
  • 6,277
  • 23
  • 87
  • 197
0
votes
1 answer

Pipeline vs Parameter Argument input?

I have a questions regard what the difference is when accepting values through either a Pipeline, or Parameter input. I ask because: Accepting values by pipeline in my script, works. Accepting values using the parameter argument such as,…
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
1 answer

Restrict Powershell from printing input commands to output stream

I am using Java ProcessStream to write input commands to powershell on my local machine. Now, the problem is that along with the output, I am seeing input commands as well. How can I restrict input command from being shown on the output. Below is…
Vishwanath
  • 149
  • 2
  • 14
0
votes
1 answer

Powershell How to get only unique result instead of all

This is my 1st question. Your help is highly appreciated. $ser1='E:\1.exe' , 'E:\2.exe' $sername=("A1Testservice","A1Testservice") foreach($ser in $sername) { foreach ($ser2 in $ser1) { New-Service -Name $ser -DisplayName $ser…
1 2 3
18
19