Ian's Software for Mere Mortals

Youngjune or Ian's blog about Connectivity

Browse by Tags

Tagged Content List
  • Blog Post: Changing text encodings of output files redirected from PowerShell.

    I created a logman setting file as follows: typeperf -q | where { $_ -like "\Phy*" } | foreach { '"' + $_.Trim() + '"' } > counter.txt But, logman raised an error reading “Invalid counter path” when I tried to update a counter data collection with the settng file, counter.txt. That’s right. Logman...
  • Blog Post: Passing arguments from the command line to downstream functions in Powershell

    $args is a special variable, an array of all arguments passed to a function on the command line. But, $args is always treated as an array in PowerShell. And It may cause an interesting side effect when passing $args to a downstream function. Suppose we define a function as follows: function t1 { “args...
  • Blog Post: How to create a function name to the global scope in a Powershell script file

    I created a script named s.ps1 to define a function named s1. # s.ps1 function s1 { // } But, after I run this script, the s1 function is not available in the global scope like: .\S.ps1 S1 s1' is not recognized as a cmdlet, function, operable program, or script file. There are two ways to...
  • Blog Post: How to create multiple or jagged arrays in Powershell

    For me, it was not apparent to create multiple dimensional or jagged arrays in Powershell. I tried the following command, but it only made a single dimensional array: $b = ((‘a’,’a’)) $b.Count 2 Bruce Payette gave me the answers for this basic question. Here is how to create multiple...
Page 1 of 1 (4 items)