配列変数の末尾にある文字を置き換える方法を見つけようとしています..さまざまな方法を試しましたが、うまくいきませんでした..これが私が持っているものです
foreach ($File in $Files){
if ($File.EndsWith(".test"))
{
#Replaces test with EURTest at the end of the string
$File2 += $_ -replace "test", "EURTest"
}
elseif ($CanBeRemovedRoamingProfile.EndsWith("CTE"))
{
# Do nothing
$File2 += $File
}
else{
$File2 += $_ + '.Final'
}
}
何か案が ?