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
1 change: 1 addition & 0 deletions linux/powershell/PSCloudShellStartup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Microsoft.PowerShell.Core\Import-Module Az.Tools.Predictor -Force

# Using the new set of az cmdlets
Microsoft.PowerShell.Core\Import-Module Az.Accounts
Az.Accounts\Update-AzConfig -CheckForUpgrade $false -Scope Process | Microsoft.PowerShell.Core\Out-Null
Az.Accounts\Enable-AzureRmAlias

# On Linux, we are not loading the profile from the clouddrive since we are already mounted on the Linux OS image: \clouddrive\.cloudconsole\acc_<user>.img
Expand Down
16 changes: 13 additions & 3 deletions linux/tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,19 @@ RUN mkdir -p /usr/cloudshell
WORKDIR /usr/cloudshell

# Powershell telemetry
ENV POWERSHELL_DISTRIBUTION_CHANNEL=CloudShell \
# don't tell users to upgrade, they can't
POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_DISTRIBUTION_CHANNEL=CloudShell

# Disable update checks for tools managed by Cloud Shell.
# CHECKPOINT_DISABLE is for Terraform.
ENV CHECKPOINT_DISABLE=1 \
POWERSHELL_UPDATECHECK=Off \
GH_NO_UPDATE_NOTIFIER=1 \
GH_NO_EXTENSION_UPDATE_NOTIFIER=1 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are users able to upgrade GitHub extensions on their own? They can for Az CLI extensions. If so, maybe we should keep those notifications.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't block the user from upgrading stuff manually. It just will stop a message from coming up in every CloudShell session until we push an update that happens to have latest.

NPM_CONFIG_UPDATE_NOTIFIER=false \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
CLIMICROSOFT365_NOUPDATE=1 \
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=true \
AZURE_BICEP_CHECK_VERSION=false

# Copy and run script to install Powershell modules and setup Powershell machine profile
COPY ./linux/powershell/ powershell
Expand Down
7 changes: 7 additions & 0 deletions tests/PSinLinuxCloudShellImage.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ Describe "Various programs installed with expected versions" -Tag "CloudShellUse
It "Has various environment vars" {
$env:AZUREPS_HOST_ENVIRONMENT | Should-Be "cloud-shell/1.0"
}

It "Disables update checks for managed PowerShell components" {
$env:POWERSHELL_UPDATECHECK | Should-Be "Off"
$config = Az.Accounts\Get-AzConfig -CheckForUpgrade
$config.Value | Should-BeFalse
$config.Scope | Should-Be "Process"
}
}

Describe "PowerShell Modules" {
Expand Down
Loading