i have the following
$file_input = "cube1_server1_partial.xml"
$CUBEName = [io.path]::GetFileNameWithoutExtension($file_input).ToUpper() -replace "_partial" #strips extension from $file_input
this results in: cube1_server1
now i have other file names that came into light, such as
cube1_server1_full.xml
i want a comprehensive replacement that doesnt necessarily have to hard code the suffix, so instead of -replace "_partial"
it should be something like -replace "_*"
from the end of a string
how can i have a comprehensive replace? maybe with regex?