SORU
12 ŞUBAT 2010, Cuma


Nasıl powershell'de bir DateTime biçimi için?

Get-Date böyle sorun komut biçimi:

$date = Get-Date -format "yyyyMMdd"

ama bir değişken a date, ne var bir kere format mı? Aşağıdaki tablo

$dateStr = $date -format "yyyMMdd"

bu hatayı döndürür:

"Bir değer girmelisiniz ifade sağ tarafı '-f'nin üzerinde ". operatör

CEVAP
12 ŞUBAT 2010, Cuma


Senin ki gibi aynı .NET.

$DateStr = $Date.ToString("yyyyMMdd")

ya

$DateStr = '{0:yyyyMMdd}' -f $Date

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Abbeydabby0277's channel

    Abbeydabby02

    9 ŞUBAT 2012
  • Autocar

    Autocar

    11 Mart 2006
  • RiceBunny

    RiceBunny

    16 ŞUBAT 2006

İLGİLİ SORU / CEVAPLAR