< 1 2 3 4 5 6 7 > >>   Sort: Rank

"Where-Object" Cmdlet in Windows PowerShell
What is the "Where-Object" cmdlet in Windows PowerShell? "Where-Object" cmdlet in Windows PowerShell takes an input of object list and generate an output object list by filtering out objects with specific criteria. Example 1: the following command uses "where-object" to filter out objects with a con...
2016-11-03, 282👍, 0💬

Introduction of Windows PowerShell Script
Where to find introduction information of Windows PowerShell script? Here is a collection of tutorials compiled by FYIcenter.com team to provide introduction information about Windows PowerShell script. Write Script File in Windows PowerShell Running Scripts Disabled in Windows PowerShell Add Commen...
2016-11-03, 270👍, 0💬

Add Comments in Windows PowerShell Scripts
How to add comments in Windows PowerShell scripts? There are two primary ways to add comments in Windows PowerShell scripts: 1. Using # in the middle of line - If you use the "#" sign in the middle of a line, everything starts from "#" to the end of line is considered as a comment. For example: Writ...
2016-11-02, 329👍, 0💬

Assign Object to Variable in Windows PowerShell Scripts
How to assign an object to a variable in Windows PowerShell scripts? The output object of a cmdlet can be assigned to a variable using the assignment operator "=". Remember, variable names must start with the "$" sign. So here is an example of assign a DateTime object to a variable: $now = Get-Date ...
2016-11-02, 255👍, 0💬

Invoke Object Methods in Windows PowerShell Scripts
How to invoke methods of an object in Windows PowerShell scripts? I know the method name in Windows PowerShell scripts. If you know the method name of an object, you can invoke and run the method using the "." operator. For example, if you run the following script: $today = Get-Date $tomorrow = $tod...
2016-11-02, 254👍, 0💬

Access Object Properties in Windows PowerShell Scripts
How to access properties of ab object in Windows PowerShell scripts? I know the property name. If you know the property name of an object, you can access the property value using the "." operator in Windows PowerShell scripts. For example, if you run the following script: $dt = Get-Date $tod = $dt.T...
2016-11-02, 253👍, 0💬

Running Scripts Disabled in Windows PowerShell
Why am I getting the "running scripts is disabled on this system" error when I try to run a Windows PowerShell script? If your system is not configured to run Windows PowerShell script, you will get an error when you type in the script file name in Windows PowerShell command line. For example: PS C:...
2016-11-02, 219👍, 0💬

If-Else Conditions in Windows PowerShell Scripts
How to use if-else conditions in Windows PowerShell scripts? PowerShell script supports the following if-else code block to help you to perform tasks depending on logical conditions: If (conditin1) { task1 } Elseif (condition2) { task2 ... } Else { other-task } Here is a sample script on how to use ...
2016-10-30, 266👍, 0💬

Console Input and Output in Windows PowerShell Scripts
How to manage console input and output in Windows PowerShell scripts? I want to write a PowerShell script that "talks" with the user. You need to use the "Write-Host" and "Read-Host" cmdlets to manage console input and output. The "Write-Host" cmdlet allows to write information to the console with s...
2016-10-30, 245👍, 0💬

Out-Host - Standard Output in Windows PowerShell Scripts
How to use the "Out-Host" cmdlet in Windows PowerShell scripts? I want to output information the standard output channel. The "Out-Host" cmdlet sends output to the Windows PowerShell host for display. The host displays the output to the PowerShell console. Because "Out-Host" is the default cmdlet, y...
2016-10-30, 243👍, 0💬

Comparison Operations in Windows PowerShell Scripts
How to use comparison operations in Windows PowerShell scripts? Can I write "$a > 0"? No, you can not use "$a>0" as a comparison operation in Windows PowerShell scripts. You must use PowerShell comparisonoperators given below: -eq Equal -ne Not equal -ge Greater than or equal -gt Greater than ...
2016-10-30, 228👍, 0💬

Logical Operations in Windows PowerShell Scripts
How to use logical (or Boolean) operations in Windows PowerShell scripts? Can I write "$a > 0 AND $a < 10"? No, you can not use "$a > 0 AND $a < 10" as a logical operation in Windows PowerShell scripts. You must use PowerShell logical operators given below: -and Logical AND -or Logical O...
2016-10-30, 228👍, 0💬

Loop Array Elements in Windows PowerShell Scripts
How to loop through all elements in an array in Windows PowerShell scripts? An array has a special property called "Length", which holds the length of the array or the number of members in the array. The "Length" property can help you to loop through all members using a simple "For {...}" loop as sh...
2016-10-29, 256👍, 0💬

Execution Loops in Windows PowerShell Scripts
How to write execution loops in Windows PowerShell scripts? I want to repeat some code multiple times. There are several ways to write execution loops in Windows PowerShell scripts. 1. "While {...}" loop - For example: $today = Get-Date "Today is "+$today.DayOfWeek $next = $today.AddDays(1) While ($...
2016-10-29, 255👍, 0💬

Loop Hashtable Members in Windows PowerShell Scripts
How to use Foreach loops in Windows PowerShell scripts? There are a couple of ways of loop through members of a hashtable. 1. Using "Keys" property - The "Keys" property holds a Collection object of all keys in a hashtable. The Collection object of keys can be used in a "Foreach {...}" loop as shown...
2016-10-29, 251👍, 0💬

Array in Windows PowerShell Scripts
What is an array in Windows PowerShell scripts? An array in Windows PowerShell is a simple data structure where pieces of data are stored in as elements in the structure in an ordered sequence. In an array, each element can be identified by the sequence index. You can create an array of objects by l...
2016-10-29, 240👍, 0💬

Hashtable in Windows PowerShell Scripts
What is a hashtables of objects in Windows PowerShell scripts? A hashtables in Windows PowerShell is a data structure where pieces of data are stored in the structure as key-value members. The value of a member represents the data, and the key of a member provides a name for the data. Hashtable keys...
2016-10-29, 218👍, 0💬

Execution Status and Errors in Windows PowerShell Scripts
How to check execution status and errors in Windows PowerShell scripts? PowerShell provides 2 automatic variables to help you checking execution status and errors: 1. $? variable - The $? variable contains the execution status of the last operation. It contains TRUE if the last operation succeeded a...
2016-10-27, 300👍, 0💬

Work with File System in Windows PowerShell
Where to find tutorials on how to work with file systems in Windows PowerShell? Here is a collection of tutorials compiled by FYIcenter.com team on working with file systems in Windows PowerShell. What Is File System in Windows PowerShell Get and Change Directory in Windows PowerShell Get Directory ...
2016-10-27, 253👍, 0💬

Run Script with Arguments in Windows PowerShell
How to write a script that take argument from the command line in Windows PowerShell? You can use the automatic variable $Args to take arguments from the command line where the script is launched. The $Args variable contains an array of all argument provided at the command line where this script was...
2016-10-27, 252👍, 0💬

What Is File System in Windows PowerShell
What is a file system from the Windows PowerShell point of view? A file system represents a logical tree of directories and files to store information on an device outside the computer CPU. For example, a harddisk drive can be considered as a filesystem. There are several interesting features suppor...
2016-10-27, 233👍, 0💬

Get and Change Directory in Windows PowerShell
How to get and change the current directory of the file system in Windows PowerShell? You can use the following cmdlets to get or change the current directory in a file system: "Get-Location" cmdlet (or "pwd" alias) returns an object that represents the current directory, much like the pwd (print wo...
2016-10-27, 231👍, 0💬

Windows PowerShell Tutorials
Where to find tutorials on using Windows PowerShell? I want to learn everything about Windows PowerShell. Here is a collection of tutorials about Windows PowerShell compiled by FYIcenter.com team. Introduction of Windows PowerShell What Is Windows PowerShell Main Features of Windows PowerShell Diffe...
2016-10-26, 2701👍, 0💬

Get Directory Entries in Windows PowerShell
How to get a list of files in a directory in Windows PowerShell? Can I use the old "dir" command? Yes, you can still use the old "dir" command in Windows PowerShell. But "dir" is defined as an alias of the "Get-ChildItem" cmdlet. The "Get-ChildItem" cmdlet gets the items in the current directory by ...
2016-10-24, 338👍, 0💬

< 1 2 3 4 5 6 7 > >>   Sort: Rank