0

I have a PowerShell script like below.

A (do health check)

B ( hereafter B executing I want to execute A again, do I need to write A after B again, or is there any away to call and execute A only and then proceed to C )

C

I hope you got what I am trying to say here.

1 Answer 1

3

Group your code into functions - named reusable blocks of code:

function A { 
  # health checks
}

function B {
  # whatever B is supposed to do
}

function C {
  # whatever C is supposed to do
}

A     # start by executing A
B     # execute B 
A     # execute A again
C     # execute C

For more information, see the about_Functions help file

Sign up to request clarification or add additional context in comments.

1 Comment

That's really helpful to build my logic. Thanks again..!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.