Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions d365fo.tools/functions/get-d365environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ function Get-D365Environment {
return
}

$Params = Get-DeepClone $PSBoundParameters
if($Params.ContainsKey("ComputerName")){$null = $Params.Remove("ComputerName")}
if($Params.ContainsKey("OutputServiceDetailsOnly")){$null = $Params.Remove("OutputServiceDetailsOnly")}
if($Params.ContainsKey("OnlyStartTypeAutomatic")){$null = $Params.Remove("OnlyStartTypeAutomatic")}
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-ServiceList

$Services = Get-ServiceList @Params

Expand All @@ -145,4 +142,4 @@ function Get-D365Environment {
}

$Results | Select-PSFObject -TypeName $outputTypeName Server, DisplayName, Status, StartType, Name
}
}
5 changes: 2 additions & 3 deletions d365fo.tools/functions/restart-d365environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ function Restart-D365Environment {

Stop-D365Environment @PSBoundParameters | Format-Table

$parms = Get-DeepClone $PSBoundParameters
if ($parms.ContainsKey("Kill")) { $null = $Params.Remove("Kill") }
$parms = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Start-D365Environment

Start-D365Environment @parms | Format-Table
}
}
7 changes: 2 additions & 5 deletions d365fo.tools/functions/start-d365environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ function Start-D365Environment {
$warningActionValue = "SilentlyContinue"
if ($ShowOriginalProgress) { $warningActionValue = "Continue" }

$Params = Get-DeepClone $PSBoundParameters
if ($Params.ContainsKey("ComputerName")) { $null = $Params.Remove("ComputerName") }
if ($Params.ContainsKey("ShowOriginalProgress")) { $null = $Params.Remove("ShowOriginalProgress") }
if ($Params.ContainsKey("OnlyStartTypeAutomatic")) { $null = $Params.Remove("OnlyStartTypeAutomatic") }
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-ServiceList

$Services = Get-ServiceList @Params

Expand Down Expand Up @@ -158,4 +155,4 @@ function Start-D365Environment {
Write-PSFMessage -Level Verbose "Results are: $Results" -Target ($Results.Name -join ",")

$Results | Select-PSFObject -TypeName "D365FO.TOOLS.Environment.Service" Server, DisplayName, Status, StartType, Name
}
}
6 changes: 2 additions & 4 deletions d365fo.tools/functions/start-d365environmentv2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ function Start-D365EnvironmentV2 {
$warningActionValue = "SilentlyContinue"
if ($ShowOriginalProgress) { $warningActionValue = "Continue" }

$Params = Get-DeepClone $PSBoundParameters
if ($Params.ContainsKey("ShowOriginalProgress")) { $null = $Params.Remove("ShowOriginalProgress") }
if ($Params.ContainsKey("OnlyStartTypeAutomatic")) { $null = $Params.Remove("OnlyStartTypeAutomatic") }
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-ServiceList

$psItemExceptionsFromStartServices = New-Object -TypeName "System.Collections.ArrayList"
$didServiceStartThrowException = $false
Expand Down Expand Up @@ -172,4 +170,4 @@ function Start-D365EnvironmentV2 {
Write-PSFMessage -Level Host -Message "Something went wrong while starting the service(s) on computer '$($ComputerName)'" -Exception $psItemException
}
}
}
}
7 changes: 2 additions & 5 deletions d365fo.tools/functions/stop-d365environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ function Stop-D365Environment {
$warningActionValue = "SilentlyContinue"
if ($ShowOriginalProgress) { $warningActionValue = "Continue" }

$Params = Get-DeepClone $PSBoundParameters
if ($Params.ContainsKey("ComputerName")) { $null = $Params.Remove("ComputerName") }
if ($Params.ContainsKey("ShowOriginalProgress")) { $null = $Params.Remove("ShowOriginalProgress") }
if ($Params.ContainsKey("Kill")) { $null = $Params.Remove("Kill") }
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-ServiceList

$Services = Get-ServiceList @Params

Expand All @@ -154,4 +151,4 @@ function Stop-D365Environment {
Write-PSFMessage -Level Verbose "Results are: $Results" -Target ($Results.Name -join ",")

$Results | Select-PSFObject -TypeName "D365FO.TOOLS.Environment.Service" Server, DisplayName, Status, StartType, Name
}
}
5 changes: 2 additions & 3 deletions d365fo.tools/internal/functions/get-azureserviceobjective.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function Get-AzureServiceObjective {
[switch] $EnableException
)

$Params = Get-DeepClone $PSBoundParameters
if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")}
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-SqlCommand

$sqlCommand = Get-SqlCommand @Params -TrustedConnection $false

Expand Down Expand Up @@ -99,4 +98,4 @@ function Get-AzureServiceObjective {
Stop-PSFFunction -Message "Stopping because of errors." -Exception $([System.Exception]::new($($messageString -replace '<[^>]+>', ''))) -ErrorRecord $_
return
}
}
}
5 changes: 2 additions & 3 deletions d365fo.tools/internal/functions/get-instancevalues.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ function Get-InstanceValues {
[switch] $EnableException
)

$Params = Get-DeepClone $PSBoundParameters
if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")}
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-SqlCommand

$sqlCommand = Get-SqlCommand @Params

Expand Down Expand Up @@ -110,4 +109,4 @@ function Get-InstanceValues {
$sqlCommand.Connection.Close()
$sqlCommand.Dispose()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ Function Invoke-ClearAzureSpecificObjects {
[switch] $EnableException
)

$Params = Get-DeepClone $PSBoundParameters
if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")}
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-SqlCommand

$sqlCommand = Get-SqlCommand @Params -TrustedConnection $false

Expand Down Expand Up @@ -90,4 +89,4 @@ Function Invoke-ClearAzureSpecificObjects {

$sqlCommand.Dispose()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Function Invoke-ClearSqlSpecificObjects {
[switch] $EnableException
)

$Params = Get-DeepClone $PSBoundParameters
if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")}
$Params = $PSBoundParameters | ConvertTo-PSFHashtable -ReferenceCommand Get-SqlCommand

$sqlCommand = Get-SqlCommand @Params

Expand Down Expand Up @@ -94,4 +93,4 @@ Function Invoke-ClearSqlSpecificObjects {

$sqlCommand.Dispose()
}
}
}
Loading