随笔分类 - PowerShell
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=5125&elq=52bc48204cc748d58a54ab9a57b6b796原文:Adding parameters to your functions is fairly easy. You can add a param() block and specify the paramete...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=5072&elq=a8251b41fe1a4d6297a0aecd8e466373原文:Did you know that you can compile any .NET source code on the fly and use this to create your own types?...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4914&elq=a3fdfdb4961d4feabec6e309570c5e33原文:PowerShell is great for parsing log files. Here is a function that extracts all installed Windows update...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4900&elq=127ab4a62a414c678d62945aef96e118原文:You will discover that Out-Printer can print results to your default printer. You can also print to any ...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4778&elq=baf9b44a60364f3fbf25d7590e9cb761原文:When you create new Aliases with Set-Alias, PowerShell does not check whether the target you specify is ...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4695&elq=c3972de70bd84be5866111fbd6571d75原文:When you output results to text files, you will find that the same width restrictions apply that are act...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4615&elq=4e53a85287814a3b889de5a05e61f869原文:Often, some text will need to be replaced in a text file. That's easy with Get-Content and Set-Content -...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4571&elq=535d59530c004cd899a9c0ff03da88a4原文:Sort-Object can sort on multiple properties at the same time. Have a look:Get-Service | Sort-Object Stat...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4513&elq=cc07fc74696e467fa7306ce10ab2a4d0原文:Get-Member is a great cmdlet to discover object members, but it will not show everything:"Hello" | Get-M...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4479&elq=5c2d3cdc5fc74ac49db66a5047abbcca原文:Sometimes you may want to tag results returned by a cmdlet with some extra information, such as a refere...
阅读全文
摘要:原文地址:http://powershell.com/cs/blogs/tips/archive/2010/06/11/creating-relative-dates.aspx原文:To create relative dates like "10 days ago," there are two paths. Administrators often add or remove time spa...
阅读全文
摘要:原文地址:http://powershell.com/cs/blogs/tips/archive/2010/06/10/create-remoting-solutions.aspx原文:Whenever you use WMI (Get-WMIObject) to retrieve information, it's a snap to turn a local solution into a r...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4322&elq=b124047d4c07443f894276bf5c6e0626原文:Ever wondered what type of RAM your PC uses and if there is a bank available to add more? Ask WMI! This ...
阅读全文
摘要:原文地址:http://powershell.com/cs/blogs/tips/archive/2010/06/08/accessing-object-properties.aspx原文:Accessing Object PropertiesObjects store information in various properties. There are two approaches if y...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4204&elq=c21eede5a82e4a9e99d852b591c961e5原文:Removing Empty ThingsHow do you exclude objects based on empty properties? For example, WMI returns all ...
阅读全文
摘要:原文地址:http://app.en25.com/e/es.aspx?s=1403&e=4273&elq=1cbc05ed0b11413db47a3b65bc2ee7a4原文:Changing File/Folder Creation DateYou should use this approach if you need to change the creation time o...
阅读全文
摘要:原文地址:http://powershell.com/cs/blogs/tips/archive/2010/06/02/filtering-day-of-week.aspx原文:Filtering Day of WeekYou can also use this little helper function if you run scripts every day and want to make...
阅读全文