<#
.SYNOPSIS
This is a test script that has a parameter with a default rawprogram4.xml.
It is used to replace 'mifs_hyp_la.img' with 'mifs_hyp_la.non_secure.img'
#>
param (
[Parameter(Position=0)] # Mandatory
[Alias("xml", "rp")]
[PSDefaultValue(Help='current rawprogram4.xml')]
[string]$file = "rawprogram4.xml"
)
# "$Args[0]" not work
################
#### MAIN ####
################
if ( -not (test-path -path $file -type Leaf)) {
echo "\""$file"\"" not found
return
}
(Get-Content $file) -replace 'mifs_hyp_la.img', 'mifs_hyp_la.non_secure.img' | Set-Content $file
powershell script template
最新推荐文章于 2024-11-12 23:57:49 发布