Skip to content

[StackHCI] Shared/generation/stackhci #19951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 26, 2022
Merged
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
8 changes: 6 additions & 2 deletions src/StackHCI/custom/stackhci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4886,6 +4886,7 @@ function Install-DeployModule {
$ModuleName
)

Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportInstallModule" -DebugEnabled ($DebugPreference -ne "SilentlyContinue")
if(Get-Module | Where-Object { $_.Name -eq $ModuleName }){
Write-InfoLog("$ModuleName is loaded already ...")
}
Expand Down Expand Up @@ -4917,7 +4918,8 @@ function Install-AzStackHCIRemoteSupport{
[CmdletBinding(SupportsShouldProcess)]
[OutputType([Boolean])]
param()


Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportInstall" -DebugEnabled ($DebugPreference -ne "SilentlyContinue")
if(Assert-IsObservabilityStackPresent){
Write-InfoLog("Install-AzStackHCIRemoteSupport is not available.")
}
Expand All @@ -4944,6 +4946,7 @@ function Remove-AzStackHCIRemoteSupport{
[OutputType([Boolean])]
param()

Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportRemove" -DebugEnabled ($DebugPreference -ne "SilentlyContinue")
if(Assert-IsObservabilityStackPresent){
Write-InfoLog("Remove-AzStackHCIRemoteSupport is not available.")
}
Expand Down Expand Up @@ -5097,10 +5100,11 @@ function Assert-IsObservabilityStackPresent{
[OutputType([Boolean])]
param()

Setup-Logging -LogFilePrefix "AzStackHCIRemoteSupportObsStackPresent" -DebugEnabled ($DebugPreference -ne "SilentlyContinue")
try{
$obsService = Get-Service -Name "*Observability RemoteSupportAgent*" -ErrorAction SilentlyContinue
$deviceType = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\AzureStack" -ErrorAction SilentlyContinue).DeviceType
if($obsService -or $deviceType -eq "AzureEdge"){
if($null -ne $obsService -or $deviceType -eq "AzureEdge"){
Write-InfoLog("AzureStack device type is AzureEdge.")
return $true
}
Expand Down