Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

I have a file with below content, i wanted to convert all the build jobs into a different format like in expected output. parallel ( { build( "job2", parameter3: value3, parameter4: ...
Hemanth's user avatar
  • 51
0 votes
0 answers
577 views

I want to test for the existence of a file path on many computers, using SMB. Many of these computers will be offline, and it takes several seconds for the SMB request to time out, so I want to run ...
Strill's user avatar
  • 255
0 votes
1 answer
721 views

I am pretty new to PowerShell scripting so I wanted to write a script that helps our apprentices in setting up new laptops for our customers. This script should rename the computer, then restart it ...
Slime's user avatar
  • 1
-1 votes
1 answer
65 views

Running a workflow which renames and restarts the computer results in an error. I had to put in screenshots because I somehow could post the code in here. PowerShell code Error code
Slime's user avatar
  • 1
0 votes
0 answers
45 views

I've the following code to execute parallels command in powershell workflow Test-Workflow { $Sites = "Param1", "Param2", "Param3" ForEach -Parallel ($...
Marc Cals's user avatar
  • 3,007
0 votes
1 answer
1k views

I have a bunch of VMs in Azure I want to run the same script against. Because of reasons, I can't use powershell 7, so I have to use powershell 5. Which means I can use "foreach -parallel", ...
mbourgon's user avatar
  • 1,368
0 votes
1 answer
506 views

I tried something like this and it starts one after the other function start-parallel { workflow work { start-process $exe1 -wait start-process $exe2 -wait } work }
user310291's user avatar
  • 38.6k
0 votes
1 answer
425 views

I have got a powershell script working, the job runs a list of servers, remotely connects to the servers and runs a simple script to get the hostname from the server. The issue is that it does get ...
learner's user avatar
  • 1,097
0 votes
0 answers
696 views

I have issues publishing a PowerShell workflow. Most of the script I am using is run in sequence, including the first for loop. But I would like to final for loop to execute in parallel. The code is ...
user13696433's user avatar
0 votes
0 answers
398 views

Usually, I use dot-sourcing to "import" my function defined in other script files. But the Powershell Workflow does not allow dot-sourcing, and it can't recognize functions defined out of ...
David Lee's user avatar
0 votes
1 answer
326 views

I wrote a script to export rows from a SQL DB, encrypt them using PGP, then transfer them using POSH-SSH v2.3.0. It all works fine, until I put it in a PowerShell WorkFlow to run multiple at a time. ...
alexander7567's user avatar
0 votes
3 answers
350 views

I'd like to add a new property to an array of objects. Add-member doesn't work, please assist $computers = Get-ADComputer -Filter {(name -like "SMZ-*-DB")} | select -First 30 workflow test-...
user2978216's user avatar
0 votes
1 answer
281 views

I have written the following runbook workflow, but from time to time I see the error when it try's to start or stop a VM: Start-AzVM : Your Azure credentials have not been set up or have expired, ...
Jeffrey's user avatar
  • 2,159
0 votes
1 answer
4k views

I have a simple workflow for running some commands within a parallel foreach loop, but cannot figure out how to print to the console from within the loop. $names = @('foo', 'bar', 'bat') Workflow ...
Brian H.'s user avatar
  • 2,255
0 votes
2 answers
1k views

I have a powershell workflow script as below: workflow mytest{ param($param1,$param2,$param3) //code } mytest $param1,$param2,$param3 Issue here is all the three params were received as ...
Sankaranand 's user avatar
0 votes
1 answer
1k views

I am creating a Powershell workflow in Azure Automation. When setting DateTime type Set-AutomationVariable with function, Recognized as a string. Please let me know if you know how to solve it. ...
Ksat's user avatar
  • 1
0 votes
1 answer
388 views

I'm trying to run two Invoke-Sqlcmd in parallel and then wait all the results. $server1 = '...' $server2 = '...' workflow work { parallel { $r1 = Invoke-Sqlcmd -ServerInstance $server1 'select ...
ca9163d9's user avatar
  • 29.6k
1 vote
1 answer
937 views

Currently trying to use PowerShell workflow to process some remote server stuff that I am doing in parallel. I am having no luck trying to get the Invoke-Command to log onto the server to actually ...
lmurdock12's user avatar
  • 1,021
0 votes
1 answer
187 views

I have several Workflow scripts defined. I want to write a master script to reference the dependent scripts. I am expecting there is some kind of Import or Include statement to reference the dependent ...
jlo-gmail's user avatar
  • 5,096
1 vote
1 answer
314 views

I have a script in PowerShell. It's running from Jenkins via a PowerShell step. Without Jenkins all works fine. But when I build it with Jenkins, I got nothing... no errors, just nothing. What's ...
lendo's user avatar
  • 35
0 votes
1 answer
2k views

I have written a script to get the offline cluster resources using foreach syntax and it is working fine. But I need to get the cluster offline resources for 50 clusters and I have tried foreach -...
Chandra Sekhar's user avatar
1 vote
2 answers
646 views

The issue I'm facing is logging the output of a function being called inside the powershell workflow into a logfile. Tried using Out-File but it is not supposed to be used for logging a specific ...
Spandana Soma's user avatar
0 votes
1 answer
3k views

This question was asked a few times before but I could not find a solution to my scenario in any of them. Basically I need the script to continue after it reboots if needed. It will check a few ...
Eran Mor's user avatar
  • 105
0 votes
0 answers
324 views

So I wrote a script to go through and optimize some VHDX files and output the results. In an effort to reduce the script run time (dramatically), I taught myself Workflow. That was an adventure on it'...
Nathanial Meek's user avatar
1 vote
1 answer
386 views

I get list of endpoints as arguments to my script, I want to send http request to all of them, but I don't want to do it in sequence, but rather simultaneously. I found that there is something like ...
Yoda's user avatar
  • 18.2k
0 votes
0 answers
396 views

I tried to disable UAC, restart the machine and install the program. I found an article how can create workflow, but it not works for me. When I run it once, the computer restarts, UAC is still ...
damHU's user avatar
  • 61
0 votes
1 answer
692 views

This is my script: workflow Run-RemoteScript { Param( [Parameter(Mandatory,Position=0)][string[]]$Targets, [Parameter(Mandatory,Position=1)][PSCredential]$Credentials, [...
Tobias KKS's user avatar
0 votes
0 answers
412 views

function function1(){ Param($a) "YOU HAVE entered : $a" $arr+=$a $arr2.Add($a) } workflow wf{ Param($b) Parallel{ sequence{ function1 $b } ...
user2906717's user avatar
0 votes
1 answer
3k views

Can anyone help with this problem? I am referring to a example from the internet for executing T-SQL statements in parallel. https://www.mssqltips.com/sqlservertip/3539/complete-common-sql-server-...
ADTJOB's user avatar
  • 85
0 votes
2 answers
2k views

I am using below script to get the details about port status of multiple remote servers. Workflow Test-OpenPortWF { [CmdletBinding()] param ( [Parameter(Position=0)] [...
SavindraSingh's user avatar
1 vote
0 answers
263 views

When I call a workflow in another workflow's foreach -parallel, I get weird and inconsistent results. Here's some sample code: workflow test-workflow1 { Start-Sleep 2 "Stuff" } workflow test-...
LavaHot's user avatar
  • 381
2 votes
0 answers
944 views

I'm trying to learn how to use Workflow in Powershell and how to get around the restrictions applied to variables (And objects in my case). But I'm facing an issue when I'm trying to modify a workflow-...
Tuttu's user avatar
  • 137
0 votes
1 answer
549 views

I have an Azure Automation Powershell Workflow: workflow wf { param( [parameter(Mandatory=$True)] [object] $p ) inlinescript { # ... } } I am testing it using the Test pane and ...
Jonas Stawski's user avatar
0 votes
0 answers
464 views

I wrote a PowerShell workflow that analyses the Excel data and triggers a mail based on the values in Excel. I have developed a workflow which triggers mail but I'm having trouble in analysing the ...
user8428195's user avatar
1 vote
1 answer
2k views

Given the following Script, how can I return two variables to the main code? I have tried the return command but show an error. Please find the code and error message below. Code: workflow Test-...
Sagor Sen Golder's user avatar
1 vote
1 answer
5k views

I am encountering this error when trying to call Invoke-RestMethod from Powershell and Powershell Workflow scripts on Azure Runbook. Unable to connect to the remote server (Unable to connect to the ...
Katy McClintic's user avatar
0 votes
1 answer
192 views

When I run the following powershell workflow : Function Start-LocalRScript { Param([Parameter(ValueFromPipeline, Mandatory)]$Name) $ScriptPath = "C:\Exploration.RScripts" $RScriptExePath = "C:\...
Mario's user avatar
  • 313
1 vote
0 answers
2k views

I'm trying to make a script that continues after a reboot. In short the script is there to deploy a PC for in the field use so the script runs local on a local machine, ideally from a thumb drive. A ...
Brilsmurfffje's user avatar
0 votes
2 answers
1k views

I am writing a PowerShell script to display the status of free space and CPU, below is snippet: function Get_FreeSpace ($authType, $comp) { $freespace = Invoke-Command -ScriptBlock { Get-...
sunny's user avatar
  • 71
1 vote
1 answer
4k views

I have something like this: workflow WF { foreach -Parallel ($computer in $computers) { $results = InlineScript { $session = New-PSSession -ComputerName $Using:computer ...
tyteen4a03's user avatar
  • 1,943
1 vote
0 answers
372 views

I'm trying to use Azure runbooks to start virtual machines with a specified tag. I use powershell workflow so i can start them i parallel. The code below works, but it always have problem starting ...
Moddaman's user avatar
  • 2,868
1 vote
0 answers
128 views

Friends, I am automating some infra related stuffs using powershell and converting that to workflows and running in SMA (Service Management Automation). Lets say if I have to automate some linux and ...
Adarsha Murthy's user avatar
1 vote
3 answers
4k views

Hi there I'm new to running powershell scripts in azure and looking for the best guidance ? I have created a powershell script to locate running machines in a resource group and output to a text file,...
BenAhm's user avatar
  • 161
3 votes
0 answers
2k views

I have a script using workflows and Foreach -Parallel -ThrottleLimit 15 which works fine if the code inside the loop is something simple like write-output or some basic math and a sleep statement, but ...
Jaboc83's user avatar
  • 302
3 votes
3 answers
842 views

I have a PowerShell script whose purpose is to get a list of files then do some work on each file. The list of files is generated by a recursive function like this: function Recurse($path) { .. ...
Artog's user avatar
  • 1,132
1 vote
0 answers
629 views

Before you try to respond to the title I am using the -force and the -confirm:$false arguments. I have been tasked with writing a script that will completely automate the promotion of a server to a ...
comp.sci.intern's user avatar
6 votes
2 answers
10k views

Does anyone know how to hide output from command Select-AzureRmSubscription inside azure workbook which runs as powershell workflow Thanks
Rafal's user avatar
  • 257
0 votes
0 answers
249 views

I want to pass $output, which is an array of json objects into $json which is an array of json objects in mod3, which is a powershell workflow. I am using this code, but it always results in an error: ...
Arnav Kundra's user avatar
5 votes
2 answers
5k views

The throttlelimit parameter of foreach -parallel can control how many processes are used when executing the script. But I can't have more than 5 processes even if I set throttlelimit greater than 5. ...
Haoshu's user avatar
  • 934
0 votes
1 answer
161 views

A newbie and first question on this forum. My first script successfully runs tests in parallel using mstest with PowerShell v4.0 workflow. But as "InlineScript" has the limitation of running 5 in ...
Vishal K's user avatar