Have you ever had to create a linked server connection on a server when you build a replacement to existing one? Here is a great one-line command to copy linked server connection from one server to another. Best part I like is that you don’t need to know the password. DBAtools will do that for you.
Copy-DbaLinkedServer -Source SQLSERVER01 -Destination SQLSERVER02 -LinkedServer SALESFORCE -Force
Copies over two SQL Server Linked Servers (SALESFORCE) from sqlserver01 to sqlserver02. With switch -Force, if the credential already exists on the destination, it will be dropped. If you want to skip the drop and create, exclude the -Force switch.