PowerShell24 [PowerShell]6. Loops Looping is a common programming concept used in PowerShell scripts to repeat a block of code mulitple times. It is the beauty of programming language. PowerShell provides three loop functions, for, foreach, while. [Loop] For The For loop function is used to iterate through a fixed number of times. The syntax of the For loop is as follows: for ($i=0; $i -lt 10; $i++) { # Code to be repeated goes .. 2023. 3. 30. [PowerShell]Checking User EmailBox Storage Status [Senario] An user set a flag that he cannot receive a meeting reschedule notification althogh other mails come to the mailbox without issue. The error message is as below. "The recipient's mailbox is full and can't accept messages now. Please try resending your message later, or contact the recipient directly." [Objective] Figure out the root cause of the issue and let the user receive meeting r.. 2023. 3. 30. [PowerShell]5. Controls(If statement) When executing a script, there are cases to control computation or process accoding to result of pre-process or conditions. PowerShell provides "if" and "switch" state in the similar grammar of C language. ["if" Statement] If statement has two parts, evaluating condition and executing code. if (condition) { # code to execute if condition is true } Below is an example of if statement PS C:\PowerS.. 2023. 3. 28. [PowerShell]4. Variables(variable converting) PowerShell does not distingush variable types. Rather PowerShell automatically declares the data type of variable when it is created. Data type is determined by data input. Let's create variables by inputting data and figure out variable type with built-in PowerShell function, "GetType" [Variable Data Type] String String variable is used when storing a mixture of characters, number and special c.. 2023. 3. 27. 이전 1 2 3 4 5 6 다음 반응형