Commands can be combined by using semi-colon ; and ampersand &&
;: All the commands will be executed irrespective of errors
&&: All the commands will be executed if there are no errors. From the moment a command returns an error code the subsequent commands will not be executed
Note
PS script
echo hello
echo 1
echo 2
shell script
echo hello
echo 1
echo 2
python script
def printargs(a,b):
print(f"values passed are {a}, {b}")
def add(a, b):
printargs(a,b)
return a+b
if __name__ == '__main__':
result = add(3, 5)
print(result)
result = add(5, 8)
print(result)