Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Getting started with powershell

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Use Get-Date in PowerShell to get the date and time and format the output

Https://www.jb51.net/article/53282.htm

Other in-depth learning links

Https://www.jb51.net/article/63887.htm

Https://www.jb51.net/list/list_234_1.htm

# # there is a cmdlet of Get-Date in PowerShell, which can be used to return the current date and time directly. Use the-Format parameter to return the current year, month, day, hour, minute, second, and so on. Yyyy M / d / h / 24 / m minutes / s # # PS H:\ > Get- date July 17, 2019 19:17:30PS H:\ > Get-Date-format yyyyMMdd20190717 example if you have heard of PowerShell for the first time and want to wait and see a little, let's take a look at the following 10 examples. [mathematical calculation] (39079-51) * 497 Universe 28 =? No matter how fast the mental arithmetic is, it should not be as fast as hitting the enter key: PS > (39th 79-51) * 497pm 281189.25 [date] how many minutes are there before the next Valentine's Day? I know how many days away is easy to calculate, what if it becomes minutes? $now=Get-Date$day= [datetime]'2-14'if ($now-lt $day) {$day.Subtract ($now) .TotalMinutes} else {$day.AddYears (1). Subtract ($now) .TotalMinutes} [capacity] 3GB > 3145726KB? can PS > 3gb-gt 3145726kbTrue [ID] produce a GUID? PS > [guid]:: NewGuid () Guid----0f283ab4-f402-400c-98ce-359442f11f1a [File] what is the size of all executable files exe in the Windows directory? Dir $env:windir-Filter * .exe | measure-Sum Length [registry] what is the value of 'Enable64Bit'' under the registry path HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ .NET Framework? (Get-ItemProperty-Path hklm:SOFTWARE\ Microsoft\ .NET Framework) .is a certificate with a fingerprint of [28DE15612AFF1CD69596AB17AF06AE86CB9C003B] in the certificate store? Ls Cert:\ LocalMachine\ My\ | where {$_ .Thumbprint-eq '28DE15612AFF1CD69596AB17AF06AE86CB9C003B'} has the printer service been started? Get-Service spooler [process] how many IE processes are currently running? (Get-Process iexplore) .count [report] exports all running process information as a HTML report? Get-Process | ConvertTo-Html | Out-File a.html now knows the power of powershell. Powershell is relatively easy to use on the windows platform.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report