1
00:00:01,640 --> 00:00:03,340
[Autogenerated] when we talk about tasks,

2
00:00:03,340 --> 00:00:06,480
PowerShell Sim does not provide task or

3
00:00:06,480 --> 00:00:09,200
job management standard. PowerShell

4
00:00:09,200 --> 00:00:11,880
commands for jobs can be executed, though,

5
00:00:11,880 --> 00:00:15,640
within a SIM connection. So what does that

6
00:00:15,640 --> 00:00:17,880
look like? Well, within the PowerShell

7
00:00:17,880 --> 00:00:20,420
tasks and jobs, we have to regular

8
00:00:20,420 --> 00:00:22,930
PowerShell commands one called Start Dash

9
00:00:22,930 --> 00:00:26,340
Job, which will start a job of some

10
00:00:26,340 --> 00:00:28,610
description, which could be any number of

11
00:00:28,610 --> 00:00:31,080
commands. All we can pass something called

12
00:00:31,080 --> 00:00:33,800
as job as a parameter, which are then

13
00:00:33,800 --> 00:00:37,330
force it to be a job. So the goal here is

14
00:00:37,330 --> 00:00:40,560
to use SIM commands remotely on a machine,

15
00:00:40,560 --> 00:00:42,850
but then utilize standard PowerShell

16
00:00:42,850 --> 00:00:45,160
commands that are not sim commands to

17
00:00:45,160 --> 00:00:48,790
manage jobs and tasks. So how do we

18
00:00:48,790 --> 00:00:52,410
execute a job locally? Well, first off, we

19
00:00:52,410 --> 00:00:55,750
can actually rap as Sim commands with

20
00:00:55,750 --> 00:00:58,810
regular PowerShell. So start dash job will

21
00:00:58,810 --> 00:01:01,100
initiate a job locally on the machine that

22
00:01:01,100 --> 00:01:03,080
we run that with. It has a parameter

23
00:01:03,080 --> 00:01:05,430
called script block and the script block

24
00:01:05,430 --> 00:01:07,320
is in the scroll are brackets and then it

25
00:01:07,320 --> 00:01:09,670
can contain any kind of PowerShell that we

26
00:01:09,670 --> 00:01:11,720
need to execute. Now, what we've done here

27
00:01:11,720 --> 00:01:13,990
is combined the two together, so we use

28
00:01:13,990 --> 00:01:16,640
regular PowerShell command to start a job,

29
00:01:16,640 --> 00:01:19,830
and then we say, Go and get the instance

30
00:01:19,830 --> 00:01:23,200
and get me the computer system. Another

31
00:01:23,200 --> 00:01:24,620
option that we have is, of course, we

32
00:01:24,620 --> 00:01:28,010
could retrieve Sim processes if we needed

33
00:01:28,010 --> 00:01:31,470
to as normal I can. Then go ahead and say,

34
00:01:31,470 --> 00:01:34,750
Start job and I could take that same

35
00:01:34,750 --> 00:01:37,720
syntax that we use previously and drop

36
00:01:37,720 --> 00:01:40,570
that into a job and then utilize what's

37
00:01:40,570 --> 00:01:43,630
called receive job with that job, IDE and

38
00:01:43,630 --> 00:01:46,580
that would return the values. So we can

39
00:01:46,580 --> 00:01:50,520
start to take regular SIM expressions or

40
00:01:50,520 --> 00:01:54,220
commands that we would use and pass those

41
00:01:54,220 --> 00:02:00,020
into the job kind of architecture. So

42
00:02:00,020 --> 00:02:02,250
let's go a little bit further. If I wanted

43
00:02:02,250 --> 00:02:06,440
to initiate a job remotely, I could say

44
00:02:06,440 --> 00:02:08,560
he's the compete to name. Here's my

45
00:02:08,560 --> 00:02:11,130
script, which is why want to executes Oh,

46
00:02:11,130 --> 00:02:13,060
session, which is going to create me a new

47
00:02:13,060 --> 00:02:15,650
SIM session, and then I wish to retrieve

48
00:02:15,650 --> 00:02:18,110
the computer system information for that

49
00:02:18,110 --> 00:02:22,230
session. I can then initiate that job by

50
00:02:22,230 --> 00:02:24,980
utilizing that script that was generated

51
00:02:24,980 --> 00:02:27,090
and then I can retrieve the information

52
00:02:27,090 --> 00:02:29,880
about that job automatically. So there's

53
00:02:29,880 --> 00:02:32,180
great power that comes with combining

54
00:02:32,180 --> 00:02:35,200
standard PowerShell commands with SIM

55
00:02:35,200 --> 00:02:39,000
commands to be able to manage tasks on other machines

