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