I'm trying to write VSCode snippet to populate a remote repo path using the local Windows repo path as the basis but struggling a little with the syntax, can anybody help?
"MetaData Snippet": {
"prefix": "META",
"body": [
"<#",
" .SYNOPSIS",
" ${1:Enter general synopsis of the type of script}",
"",
" .DESCRIPTION",
" ${2:Short description of what the script will do}",
"",
" .PARAMETER ${3:ParameterNameHere}",
" ${4:Description of the parameter}",
"",
" .EXAMPLE",
" ${5:Example of how to use the code and also expected output}",
"",
" .NOTES",
" VSTS: ${7:$TM_FILEPATH/(.)(:\\)(.*)(\\TSO NH)//g}",
"",
" | Author | QC | VSTS Story ID | Release Date |",
" -----------------------------------------------------------------------------",
" | ${8:Author Name} | ${9:Name of reviewer} | ${10:Story Number} | $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR_SHORT |",
"#>"
],
"description": "MetaData Snippet"
}
EXAMPLE PATH: c:\Users\USERNAME\git\Cloud and Automation\.vscode\test.ps1
Essentially I want to chop out c:\Users\USERNAME\git\ and the remainder I want to replace the \ characters with /.
I know my syntax is wrong but I'm not sure I understand regex well enough and can't figure it out :(
To summarize I want to turn:
c:\Users\USERNAME\git\Cloud and Automation\.vscode\test.ps1
into:
Cloud and Automation/.vscode/test.ps1