PowerShell: "The variable '$elapsed' cannot be retrieved because it has not been set."
@theJasonHelmick ci sta già lavorando.
Dal 9/3/2023.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- PowerShell
- Stelle
- 273
- Fork
- 116
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/CloudShell
-
bug Triage-needed
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
Azure/CloudShell#655 ·
-
Blood TestAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
Azure/CloudShell#654 · 2 commenti ·
-
bug Triage-needed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
Azure/CloudShell#653 ·
-
bug Triage-needed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
Azure/CloudShell#649 · 2 commenti ·
-
[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 subscriptionsForse già presa @priyaananthasankar l’ha presa 22 giorni fa. Apertabug
Azure/CloudShell#648 · 1 commento · 1 assegnatario ·