惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Heimdal Security Blog
SecWiki News
SecWiki News
H
Hacker News: Front Page
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
AI
AI
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
PCI Perspectives
PCI Perspectives
S
Securelist
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
Forbes - Security
Forbes - Security
T
Tor Project blog
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
I
Intezer
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
博客园 - 司徒正美
W
WeLiveSecurity
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
V
Vulnerabilities – Threatpost
Jina AI
Jina AI
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
T
Threatpost
P
Privacy International News Feed
人人都是产品经理
人人都是产品经理
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - Vincent Yang

Cannot load macro project error SQL Express - "Failed generate a user instance..." SQL Express 2008 x64 Integration with Visual Studio 2008 SP1 Crystal Reports .NET Error - "Access to report file denied. Another program may be using it." - Vincent Yang (转:)SharePoint Database Naming Standards List Types & List Internal ID available within MOSS 2007 Telerik: IIS7 & IIS 7.5 and ‘Telerik.Web.UI.WebResource.axd’ is missing in web config 64bit SQL Server issues : Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly 正式入住Windows 7 + XPM A Generic Singleton Form Provider for C# Extreme Programming: Do these 12 practices make perfect? Pick up the pace with extreme programming Testing an ASP.NET Web Service using PowerShell Parsing XML Files with PowerShell Testing SQL Stored Procedures using PowerShell Working with Collections of Objects using PowerShell Generating iCalender file using ASP.NET SQL Server Precision And Scale Problems (SQL Server 精度问题) Six Quick Crystal Reports Design Tips
PowerShell Operators
Vincent Yang · 2010-02-06 · via 博客园 - Vincent Yang

PowerShell's Operators

Operator

Definition

## The hash key is for comments
+Add
-Subtract
*Multiply 
/Divide
%Modulus (Some call it Modulo) - Means remainder 17 % 5 = 2 Remainder
=equal
-notlogical not equal
!logical not equal
-bandbinary and
-borbinary or 
-bnotbinary not
-replaceReplace (e.g.  "abcde" –replace "b","B") (case insensitive)
-ireplaceCase-insensitive replace (e.g.  "abcde" –ireplace "B","3")
-creplaceCase-sensitive replace (e.g.  "abcde" –creplace "B","3")
-andAND (e.g. ($a -ge 5 -AND $a -le 15) )
-orOR  (e.g. ($a –eq "A" –OR $a –eq "B") )
-isIS type (e.g. $a -is [int] )
-isnotIS not type (e.g. $a -isnot [int] )
-asconvert to type (e.g. 1 -as [string] treats 1 as a string )
..Range operator (e.g.  foreach ($i in 1..10) {$i }  )
&call operator (e.g. $a = "Get-ChildItem" &$a executes Get-ChildItem)
. (dot followed by a space)call operator (e.g. $a = "Get-ChildItem" . $a executes Get-ChildItem in the current scope)
..Period or .full stop for an objects properties
$CompSys.TotalPhysicalMemory
-FFormat operator (e.g. foreach ($p in Get-Process) { "{0,-15} has {1,6} handles" –F  $p.processname,$p.Handlecount } )

PowerShell's Conditional or Comparison Operators

Operator

Definition

-ltLess than
-leLess than or equal to
-gtGreater than
-geGreater than or equal to
-eqEqual to
-neNot Equal to
-containsDetermine elements in a group. 
This always returns Boolean $True or $False.
-notcontainsDetermine excluded elements in a group
This always returns Boolean $True or $False.
-likeLike - uses wildcards for pattern matching
-notlikeNot Like - uses wildcards for pattern matching
-matchMatch - uses regular expressions for pattern matching
-notmatchNot Match - uses regular expressions for pattern matching
 Bitwise
-bandBitwise AND
-borBitwise OR
-isIs of Type
-isnotIs not of Type
 Other Operators
if(condition)If condition
elseIf(condition)ElseIF
else(condition)Else
>Redirect, for example, output to text file
Example   .\cmdlet > stuff.txt
>>Same as Redirect except it appends to an existing file