PowerShell25 [PowerShell]7. Functions Function in programming lanugage is a reuseable block of code performing set of tasks. With a function in programing language, developer does not need to write the same code every time when executing a certain task, rather simply call a function with parameters then it will do it's magic. [Grammar] PowerShell function consists of function name, parameters and code block. function TestFunction{ p.. 2023. 4. 3. [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. 이전 1 2 3 4 5 6 7 다음 반응형