Below is the auto-generated example.txt file:
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
And the output should be like below using regex or any other command:
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
How to do it in powerShell.
The file is auto-generated, so there may be from 0 to n time blocks available in a file, like this:
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
Application Name: XYZSNWJ
Secret Key: NDRkNDJcvWDFW
Application Name: XYZSNWKkms
Secret Key: DFSmnbaDFAsdc
Application Name: HBDFJHXPI
Application Name: XHjacvJHasxb
then how it should be repeated till the end of file.