invoke-command Questions
3
I write a very simple powershell script to post a json string to server. I have a strange issue when I execute the script.
The server is inside our intranet, the firewall is disable for all intr...
Cathycathyleen asked 8/8, 2016 at 13:47
2
Solved
I am attempting to create a class object and use Invoke-Command to call a function on the class on a remote machine. When I use Invoke-Command with no computer name this works fine but when I attem...
Ellipticity asked 24/1, 2020 at 15:25
3
Solved
I have to get Event-Logs from some servers and I don't want to read in the credentials for each server which is found.
I've tried to pass my variables by using the ArgumentList parameter but I doe...
Kalvn asked 31/3, 2016 at 8:58
2
I have a function that works with the invoke-command function either without any arguments or with all arguments. What I would like to do is run the function via invoke-command with only 1 argument...
Orenorenburg asked 25/2, 2022 at 21:49
4
Solved
I'm trying to communicate with a service over powershell but I am failing miserably. I suspect it is the certificate and I have googled for the answer and found two options, none of which worked fo...
Vagrant asked 2/9, 2015 at 14:13
5
Solved
I have a script that I can run remotely via Invoke-Command
Invoke-Command -ComputerName (Get-Content C:\Scripts\Servers.txt) `
-FilePath C:\Scripts\ArchiveEventLogs\ver5\ArchiveEventLogs.ps1
As...
Confirmatory asked 19/11, 2010 at 14:8
5
Solved
My question is very similar to this one, except I'm trying to capture the return code of a ScriptBlock using Invoke-Command (so I can't use the -FilePath option). Here's my code:
Invoke-Command -c...
Chadd asked 18/12, 2011 at 1:18
3
I'm stuck trying to figure this out. I've seen the other articles and have tried everything, but I'm not getting anywhere. I am trying to pass an array as an argument to another PS script. Here's w...
Crewelwork asked 10/7, 2013 at 18:0
2
Solved
I'm trying to run invoke-command to launch a powershell script in a powershell file on a remote computer. I'm using the credentials for a user with Administrator privilege. The command needs to be ...
Dated asked 26/11, 2020 at 12:35
2
Solved
I am building a new network with Server 2016 and a handful of Windows 10 clients. I have run Enable-PSRemoting successfully on all the clients. From the server I run:
Invoke-Command -ComputerName ...
Freehanded asked 19/10, 2017 at 13:21
3
Solved
I'm having trouble running multiple commands within a Scriptblock parameter. All documentation points towards using a semicolon for separation between cmdlets. Using the same methodology of separat...
Orthicon asked 1/8, 2016 at 18:2
2
I have a number of remote jobs started with a Powerhsell invoke-command -session command. In some cases, at least one of the remote child job exits, but the local PS session state reports the jobs ...
Ordovician asked 17/6, 2015 at 0:37
4
Solved
I am trying to install a service on a remote machine using the powershell.
So far I have the following:
Invoke-Command -ComputerName $remoteComputerName -ScriptBlock {
param($password=$password,...
Smoke asked 26/9, 2012 at 11:41
1
Solved
$logstring = Invoke-Command -ComputerName $filesServer -ScriptBlock {
param(
$logstring,
$grp
)
$Klassenbuchordner = "KB " + $grp.Gruppe
$Gruppenordner = $grp.Gruppe
$share = $grp.Gruppe
$...
Buckeye asked 20/2, 2019 at 15:33
1
Solved
I was trying to measure some ways to write to files in PowerShell. No question about that but I don't understand why the first Measure-Command statement below takes longer to be executed than the 2...
Floweret asked 9/2, 2017 at 13:41
6
Solved
How is it possible to use the parameters collected in a hash table for use with ArgumentList on Invoke-Command?
$CopyParams = @{
Source = 'E:\DEPARTMENTS\CBR\SHARE\Target'
Destination = 'E:\DEPA...
Coldshoulder asked 30/1, 2015 at 11:4
3
Solved
I'd like to pass all arguments that were given to the script and execute.
For example, given execute.ps1 script:
Invoke-Expression $($args[0])
I can run:
.\execute.ps1 hostname
myhostname
Sa...
Foushee asked 26/7, 2018 at 16:56
3
Solved
managed to get the JSON data with
$R= Invoke-WebRequest -Uri $url -Headers $headers -ContentType "application/json" -Method Get -UseBasicParsing
$x = $R.Content | Out-String | ConvertFrom-Json
...
Asthenic asked 6/3, 2018 at 16:55
1
Solved
I'm trying to execute Azure Table Storage API using Powershell Invoke-RestMethod but it returns 415 error.
Here's Powershell code:
$accessKey = "accesskey"
$account_name = "storage account"
$tabl...
Topdrawer asked 10/11, 2017 at 1:11
7
Solved
I have a script that reads a configuration file that results in a set of name value pairs that I would like to pass as arguments to a function in a second PowerShell script.
I do not know what para...
Proclus asked 12/10, 2012 at 0:12
1
Solved
I am able to run the below powershell command through Powershell itself,
invoke-command -ComputerName "compName" -filepath "c:\script.ps1" -credential "admin"
but when I try running that through...
Alluring asked 31/10, 2016 at 22:13
2
I'm trying to write a one-liner to leverage some of the capabilities of netbackup remotely. I know how to pass parameters to Invoke Command using -args[0] and [1] at the end, with repeating paramet...
Kiangsu asked 4/10, 2016 at 3:37
3
Solved
I'm writing a Powershell script which executes one of the steps in my build/deploy process, and it needs to run some actions on a remote machine. The script is relatively complex, so if an error oc...
Intermit asked 4/2, 2016 at 11:27
3
I am trying to execute an exe on a remote computer using invoke-command. Executing the exe on the remote machine after logging into the machine using remote desktop takes 1GB of memory and executes...
Margravine asked 12/3, 2012 at 11:11
2
Solved
I am writing a script to stop and start services in two remote servers.
Here's my question,
in my script I did new-pssession and used invoke-command to stop and start services.
Do I need to use e...
Comeback asked 5/1, 2016 at 19:12
1 Next >
© 2022 - 2024 — McMap. All rights reserved.