2015-10-23 01:35:31 +02:00
|
|
|
|
Describe "Get-PSDrive" {
|
2015-12-29 00:43:24 +01:00
|
|
|
|
|
2015-07-21 19:08:09 +02:00
|
|
|
|
It "Should not throw" {
|
2015-09-23 20:33:33 +02:00
|
|
|
|
Get-PSDrive | Should Not BeNullOrEmpty
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Should have a name and a length property" {
|
2015-11-30 23:54:05 +01:00
|
|
|
|
(Get-PSDrive).Name | Should Not BeNullOrEmpty
|
2015-07-21 19:08:09 +02:00
|
|
|
|
(Get-PSDrive).Root.Length | Should Not BeLessThan 1
|
2015-09-23 20:33:33 +02:00
|
|
|
|
}
|
2015-07-21 19:08:09 +02:00
|
|
|
|
|
2015-09-23 20:33:33 +02:00
|
|
|
|
It "Should be able to be called with the gdr alias" {
|
|
|
|
|
{ gdr } | Should Not Throw
|
|
|
|
|
|
|
|
|
|
gdr | Should Not BeNullOrEmpty
|
2015-07-21 19:08:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-10-03 00:31:16 +02:00
|
|
|
|
It "Should be the same output between Get-PSDrive and gdr" {
|
|
|
|
|
$alias = gdr
|
|
|
|
|
$actual = Get-PSDrive
|
|
|
|
|
|
|
|
|
|
$alias | Should Be $actual
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-21 19:08:09 +02:00
|
|
|
|
It "Should return drive info"{
|
2015-07-24 19:38:51 +02:00
|
|
|
|
(Get-PSDrive Env).Name | Should Be Env
|
2015-12-29 00:43:24 +01:00
|
|
|
|
(Get-PSDrive Cert).Root | Should Be \
|
2015-11-30 23:54:05 +01:00
|
|
|
|
|
2016-03-04 23:39:18 +01:00
|
|
|
|
if ($IsWindows)
|
2015-11-30 23:54:05 +01:00
|
|
|
|
{
|
2015-12-29 00:43:24 +01:00
|
|
|
|
(Get-PSDrive C).Provider.Name | Should Be FileSystem
|
2015-11-30 23:54:05 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-12-29 00:43:24 +01:00
|
|
|
|
(Get-PSDrive /).Provider.Name | Should Be FileSystem
|
2015-11-30 23:54:05 +01:00
|
|
|
|
}
|
2015-07-21 19:08:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-09-23 20:33:33 +02:00
|
|
|
|
It "Should be able to access a drive using the PSProvider switch" {
|
2015-07-21 19:08:09 +02:00
|
|
|
|
(Get-PSDrive -PSProvider FileSystem).Name.Length | Should BeGreaterThan 0
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-23 20:33:33 +02:00
|
|
|
|
It "Should return true that a drive that does not exist"{
|
2015-07-21 19:08:09 +02:00
|
|
|
|
!(Get-PSDrive fake -ErrorAction SilentlyContinue) | Should Be $True
|
2015-09-23 20:33:33 +02:00
|
|
|
|
Get-PSDrive fake -ErrorAction SilentlyContinue | Should BeNullOrEmpty
|
2015-07-21 19:08:09 +02:00
|
|
|
|
}
|
2015-07-21 19:34:12 +02:00
|
|
|
|
}
|