Question
How to add the file extension .txt to a file ?

The following Get-Extension function adds the .txt file name extension to a file name that you supply:

function Get-Extension { $name =$args[0] + ".txt" $name }  Get-Extension myTextFile  myTextFile.txt Question How to add the file extension .txt to a file ? Answer ? Question How to add the file extension .txt to a file ? Answer The following Get-Extension function adds the .txt file name extension to a file name that you supply: function Get-Extension {$name = $args[0] + ".txt"$name
}

Get-Extension myTextFile

myTextFile.txt
If you want to change selection, open document below and click on "Move attachment"

the function name. Positional parameter values are assigned to the $args array variable. The value that follows the function name is assigned to the first position in the$args array, $args[0]. <span>The following Get-Extension function adds the .txt file name extension to a file name that you supply: function Get-Extension {$name = $args[0] + ".txt"$name } Get-Extension myTextFile myTextFile.txt Switch Parameters A switch is a parameter that does not require a value. Instead, you type the function name followed by the name of the switch parameter. To define a switch parameter,

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions