PowerShell: "The variable '$elapsed' cannot be retrieved because it has not been set."

Đang mở
#284 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@theJasonHelmick đang làm issue này rồi.

Từ ngày 9/3/2023.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Area-image bug Iteration-Backlog

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:
image

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.

Ngôn ngữ chính
PowerShell
Star
273
Fork
116
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/CloudShell

Tất cả issue của Azure/CloudShell

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.