1
00:00:03,340 --> 00:00:08,540
Custom PSDrive can be created by using New‑PSDrive PowerShell command.

2
00:00:08,540 --> 00:00:12,080
Custom PSDrives can be created in different providers.

3
00:00:12,080 --> 00:00:15,960
Just as you can create a PSDrive in file system providers,

4
00:00:15,960 --> 00:00:20,140
you can also create PSDrives in registry providers,

5
00:00:20,140 --> 00:00:22,740
as well as certificate providers.

6
00:00:22,740 --> 00:00:26,860
So, if you create a new PSDrive in file system provider,

7
00:00:26,860 --> 00:00:31,940
you will be able to manage files and folders under that PSDrive.

8
00:00:31,940 --> 00:00:37,690
You may create a PSDrive mapped to a registry path to manage registry values,

9
00:00:37,690 --> 00:00:40,310
and you may create a PSDrive mapped to a

10
00:00:40,310 --> 00:00:44,340
certificate store to manage certificates.

11
00:00:44,340 --> 00:00:49,650
Custom PSDrives act as a shortcut to navigate to a path in datastore,

12
00:00:49,650 --> 00:00:53,640
like file system and registry.

13
00:00:53,640 --> 00:00:57,310
These drives can be temporary or persistent in nature.

14
00:00:57,310 --> 00:00:59,110
By default,

15
00:00:59,110 --> 00:01:03,170
the PSDrive that you create will be temporary and will exist

16
00:01:03,170 --> 00:01:07,340
only in the session in which it is created.

17
00:01:07,340 --> 00:01:11,820
You can give any name to this drive that is valid in PowerShell.

18
00:01:11,820 --> 00:01:15,680
Temporary drives can be created for a local resource

19
00:01:15,680 --> 00:01:19,240
or a resource on a remote server.

20
00:01:19,240 --> 00:01:22,890
Now, when I say a resource, it can be a folder path,

21
00:01:22,890 --> 00:01:23,990
a registry path,

22
00:01:23,990 --> 00:01:30,240
or a certificate store path on local server or on a remote server.

23
00:01:30,240 --> 00:01:33,140
Since temporary drives are session specific,

24
00:01:33,140 --> 00:01:38,240
they cannot be managed using other methods like Net Use command.

25
00:01:38,240 --> 00:01:40,510
However, within the same session,

26
00:01:40,510 --> 00:01:44,740
you can carry out some common operations in the temporary PSDrive,

27
00:01:44,740 --> 00:01:50,040
like changing the location within the drive using set‑location command,

28
00:01:50,040 --> 00:01:56,430
managing child objects using commands such as get‑item and get‑child‑item.

29
00:01:56,430 --> 00:02:02,370
Persistent PSDrive, on the other hand, will be available to use in the same,

30
00:02:02,370 --> 00:02:05,740
as well as in other PowerShell sessions.

31
00:02:05,740 --> 00:02:08,520
If you want to create a persistent PSDrive,

32
00:02:08,520 --> 00:02:14,010
you will need to include persist parameter in the new PSDrive command.

33
00:02:14,010 --> 00:02:19,340
Persistent drives work in the same fashion as temporary drives.

34
00:02:19,340 --> 00:02:23,850
The only difference here is that persistent drives can be created only

35
00:02:23,850 --> 00:02:28,440
for a file system location on a remote computer,

36
00:02:28,440 --> 00:02:35,040
and it should be mapped only by a drive letter between A to Z.

37
00:02:35,040 --> 00:02:40,910
You cannot simply map a local folder in a persistent drive. Persistent

38
00:02:40,910 --> 00:02:46,710
drives can also be viewed using Net Use command. Even though persistent

39
00:02:46,710 --> 00:02:49,740
drives are retained in other PowerShell sessions,

40
00:02:49,740 --> 00:02:53,040
they disappear after a system reboot.

41
00:02:53,040 --> 00:02:56,010
So, if you have a requirement where you have to

42
00:02:56,010 --> 00:02:59,050
consistently keep a custom PSDrive intact,

43
00:02:59,050 --> 00:03:01,840
even after a reboot,

44
00:03:01,840 --> 00:03:06,380
you can have a login script set for your account or have

45
00:03:06,380 --> 00:03:10,040
that drive set in your PowerShell profile.

46
00:03:10,040 --> 00:03:11,340
Later in the demo,

47
00:03:11,340 --> 00:03:15,990
we will set a PowerShell profile to include a persistent drive, so

48
00:03:15,990 --> 00:03:22,000
that whenever we start a new PowerShell session, this drive will be available to us.

