Skip to content

Commit bf1515a

Browse files
committed
Fixup tests with default PowerShell Formatting
1 parent dfc0391 commit bf1515a

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

test/PowerShellEditorServices.Test.Shared/Refactoring/Variables/RefactorVariablesData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ internal static class RenameVariableData
117117
public static readonly RenameSymbolParams VariableScriptWithParamBlock = new()
118118
{
119119
FileName = "VariableScriptWithParamBlock.ps1",
120-
Column = 28,
120+
Column = 30,
121121
Line = 1,
122122
RenameTo = "Renamed"
123123
};
@@ -130,7 +130,7 @@ internal static class RenameVariableData
130130
};
131131
public static readonly RenameSymbolParams VariableParameterCommandWithSameName = new()
132132
{
133-
FileName = "VariableParameterCommndWithSameName.ps1",
133+
FileName = "VariableParameterCommandWithSameName.ps1",
134134
Column = 13,
135135
Line = 9,
136136
RenameTo = "Renamed"
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function Test-AADConnected {
22

33
param (
4-
[Parameter(Mandatory = $false)][Alias("UPName")][String]$UserPrincipalName
4+
[Parameter(Mandatory = $false)][String]$UserPrincipalName
55
)
66
Begin {}
77
Process {
@@ -16,10 +16,10 @@ function Test-AADConnected {
1616
}
1717

1818
function Set-MSolUMFA{
19-
[CmdletBinding(SupportsShouldProcess=$true)]
19+
[CmdletBinding(SupportsShouldProcess = $true)]
2020
param (
21-
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$UserPrincipalName,
22-
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][ValidateSet('Enabled','Disabled','Enforced')][String]$StrongAuthenticationRequiremets
21+
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)][string]$UserPrincipalName,
22+
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)][ValidateSet('Enabled', 'Disabled', 'Enforced')][String]$StrongAuthenticationRequiremets
2323
)
2424
begin{
2525
# Check if connected to Msol Session already
@@ -29,28 +29,28 @@ function Set-MSolUMFA{
2929
Write-Verbose('Initiating connection to Msol')
3030
Connect-MsolService -ErrorAction Stop
3131
Write-Verbose('Connected to Msol successfully')
32-
}catch{
32+
} catch{
3333
return Write-Error($_.Exception.Message)
3434
}
3535
}
36-
if(!(Get-MsolUser -MaxResults 1 -ErrorAction Stop)){
36+
if (!(Get-MsolUser -MaxResults 1 -ErrorAction Stop)){
3737
return Write-Error('Insufficient permissions to set MFA')
3838
}
3939
}
4040
Process{
4141
# Get the time and calc 2 min to the future
4242
$TimeStart = Get-Date
4343
$TimeEnd = $timeStart.addminutes(1)
44-
$Finished=$false
44+
$Finished = $false
4545
#Loop to check if the user exists already
46-
if ($PSCmdlet.ShouldProcess($UserPrincipalName, "StrongAuthenticationRequiremets = "+$StrongAuthenticationRequiremets)) {
46+
if ($PSCmdlet.ShouldProcess($UserPrincipalName, 'StrongAuthenticationRequiremets = ' + $StrongAuthenticationRequiremets)) {
4747
}
4848
}
4949
End{}
5050
}
5151

5252
Set-MsolUser -UserPrincipalName $UPN -StrongAuthenticationRequirements $sta -ErrorAction Stop
53-
$UserPrincipalName = "Bob"
53+
$UserPrincipalName = 'Bob'
5454
if ($UserPrincipalName) {
5555
$SplatTestAADConnected.Add('UserPrincipalName', $UserPrincipalName)
5656
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ function Test-AADConnected {
1616
}
1717

1818
function Set-MSolUMFA{
19-
[CmdletBinding(SupportsShouldProcess=$true)]
19+
[CmdletBinding(SupportsShouldProcess = $true)]
2020
param (
21-
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$UserPrincipalName,
22-
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][ValidateSet('Enabled','Disabled','Enforced')][String]$StrongAuthenticationRequiremets
21+
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)][string]$UserPrincipalName,
22+
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)][ValidateSet('Enabled', 'Disabled', 'Enforced')][String]$StrongAuthenticationRequiremets
2323
)
2424
begin{
2525
# Check if connected to Msol Session already
@@ -29,28 +29,28 @@ function Set-MSolUMFA{
2929
Write-Verbose('Initiating connection to Msol')
3030
Connect-MsolService -ErrorAction Stop
3131
Write-Verbose('Connected to Msol successfully')
32-
}catch{
32+
} catch{
3333
return Write-Error($_.Exception.Message)
3434
}
3535
}
36-
if(!(Get-MsolUser -MaxResults 1 -ErrorAction Stop)){
36+
if (!(Get-MsolUser -MaxResults 1 -ErrorAction Stop)){
3737
return Write-Error('Insufficient permissions to set MFA')
3838
}
3939
}
4040
Process{
4141
# Get the time and calc 2 min to the future
4242
$TimeStart = Get-Date
4343
$TimeEnd = $timeStart.addminutes(1)
44-
$Finished=$false
44+
$Finished = $false
4545
#Loop to check if the user exists already
46-
if ($PSCmdlet.ShouldProcess($UserPrincipalName, "StrongAuthenticationRequiremets = "+$StrongAuthenticationRequiremets)) {
46+
if ($PSCmdlet.ShouldProcess($UserPrincipalName, 'StrongAuthenticationRequiremets = ' + $StrongAuthenticationRequiremets)) {
4747
}
4848
}
4949
End{}
5050
}
5151

5252
Set-MsolUser -UserPrincipalName $UPN -StrongAuthenticationRequirements $sta -ErrorAction Stop
53-
$UserPrincipalName = "Bob"
53+
$UserPrincipalName = 'Bob'
5454
if ($UserPrincipalName) {
5555
$SplatTestAADConnected.Add('UserPrincipalName', $UserPrincipalName)
5656
}

test/PowerShellEditorServices.Test.Shared/Refactoring/Variables/VariableScriptWithParamBlock.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param([int]$Count=50, [int]$DelayMilliSeconds=200)
1+
param([int]$Count = 50, [int]$DelayMilliSeconds = 200)
22

33
function Write-Item($itemCount) {
44
$i = 1

0 commit comments

Comments
 (0)