2016-03-04 23:48:30 +01:00
|
|
|
Describe "New-Alias" {
|
2015-10-22 19:55:58 +02:00
|
|
|
It "Should be able to be called using the name and value parameters without error" {
|
2016-03-04 23:52:27 +01:00
|
|
|
{ New-Alias -Name testAlias -Value 100 } | Should Not Throw
|
2015-10-22 19:55:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should have the same output between the alias and the original cmdlet" {
|
2016-03-04 23:52:27 +01:00
|
|
|
New-Alias -Name testAlias -Value Get-Process
|
2015-10-22 19:55:58 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
$aliasId = $(testAlias).Id
|
|
|
|
$cmdletId = $(Get-Process).Id
|
|
|
|
foreach ($IdNumber in $aliasId)
|
|
|
|
{
|
|
|
|
$aliasId[$IdNumber] | Should Be $cmdletId[$IdNumber]
|
|
|
|
}
|
2015-10-22 19:55:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should be able to call the New-Alias cmdlet using the nal alias without error" {
|
2016-03-04 23:52:27 +01:00
|
|
|
{ nal -Name testAlias -Value 100 } | Should Not Throw
|
2015-10-22 19:55:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
It "Should have the same output between the nal alias and the New-Alias cmdlet" {
|
2016-03-04 23:52:27 +01:00
|
|
|
nal -Name testAlias -Value Get-Process
|
2015-10-22 19:55:58 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
New-Alias -Name testalias2 -Value Get-Process
|
2015-10-22 19:55:58 +02:00
|
|
|
|
2016-03-04 23:52:27 +01:00
|
|
|
$aliasData = $(testAlias).Id
|
|
|
|
$cmdletData = $(testAlias2).Id
|
|
|
|
|
|
|
|
foreach ($IdNumber in $aliasData)
|
|
|
|
{
|
|
|
|
$aliasData[$IdNumber] | Should Be $cmdletData[$IdNumber]
|
|
|
|
}
|
2015-10-22 19:55:58 +02:00
|
|
|
}
|
2016-03-04 23:48:30 +01:00
|
|
|
}
|