PowerShell: "The variable '$elapsed' cannot be retrieved because it has not been set."
@theJasonHelmick já está trabalhando nisso.
Desde 9/3/2023.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
When I now log in to Azure Cloud Shell using PowerShell I get this error:
InvalidOperation: /opt/microsoft/powershell/7/profile.ps1:268
Line |
268 | if($elapsed -gt '1000')
| ~~~~~~~~
| The variable '$elapsed' cannot be retrieved because it has not been set.
here's what is happening:

The profile file /opt/microsoft/powershell/7/profile.ps1 is part of the Azure Cloud Shell.
I have Set-StrictMode -Version latest in my PowerShell profile. If I remove this the error goes away.
I think the default for Azure Cloud Shell PowerShell should use strict mode to catch unnecessary issues.
- Linguagem predominante
- PowerShell
- Estrelas
- 273
- Forks
- 116
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Azure/CloudShell
-
bug Triage-needed
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 30/100
Azure/CloudShell#655 ·
-
Blood TestAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 5/100
Azure/CloudShell#654 · 2 comentários ·
-
bug Triage-needed
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
Azure/CloudShell#653 ·
-
bug Triage-needed
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
Azure/CloudShell#649 · 2 comentários ·
-
[BUG] Bash session falls back to ephemeral (“Failed to mount the Azure file share”) after $HOME image is attached; intermittent across 5 file shares, 3 storage accounts, 2 subscriptionsTalvez já em andamento @priyaananthasankar assumiu há 22 dias. Abertabug
Azure/CloudShell#648 · 1 comentário · 1 responsável ·