10-28-2022, 03:38 AM
Hi,
I want to get all the content between the two tags (#if ... #endif)
I have the following powershell code, requests the QM code with the same effect
Thanks in advance for any advice and help
david
Powershell code:
Macro Macro10
I want to get all the content between the two tags (#if ... #endif)
I have the following powershell code, requests the QM code with the same effect
Thanks in advance for any advice and help
david
Powershell code:
$s = @'
public static void Main(string[] args)
{
#if A
part1
#endif
part
part
#if V
part2
#endif
part
part
#if C
part3
#endif
}
'@ -split [Environment]::NewLine
$between = $false
$ss= Switch -regex ($s)
{
'#if.+|#endif' {
$between = !$between
}
Default {
If ($between)
{
$_
}
}
}
$ss
Macro Macro10