File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
test/powershell/Modules/Microsoft.PowerShell.Management Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change
1
+ # get a random string of characters a-z and A-Z
1
2
function Get-RandomString
2
3
{
3
4
param ( [int ]$length = 8 )
4
5
$chars = .{ ([int ][char ]' a' ).. ([int ][char ]' z' );([int ][char ]' A' ).. ([int ][char ]' Z' ) }
5
6
([char []]($chars | get-random - count $length )) -join " "
6
7
}
7
8
9
+ # get a random string which is not the name of an existing provider
8
10
function Get-NonExistantProviderName
9
11
{
10
12
param ( [int ]$length = 8 )
@@ -14,6 +16,7 @@ function Get-NonExistantProviderName
14
16
$providerName
15
17
}
16
18
19
+ # get a random string which is not the name of an existing drive
17
20
function Get-NonExistantDriveName
18
21
{
19
22
param ( [int ]$length = 8 )
@@ -23,6 +26,7 @@ function Get-NonExistantDriveName
23
26
$drivename
24
27
}
25
28
29
+ # get a random string which is not the name of an existing function
26
30
function Get-NonExistantFunctionName
27
31
{
28
32
param ( [int ]$length = 8 )
You can’t perform that action at this time.
0 commit comments