I am trying below code(in .dtsx) :-
Clear-Host
# Define the path to the 32-bit dtexec.exe
$dtexecPath = "C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\dtexec.exe"
# Define the path to the SSIS package (.dtsx file)
$packagePath = "E:\Practice_SSIS\All_Package\Demo\Demo\Demo\Demo\Demo.dtsx"
# Build the command to execute the SSIS package
$command = "& '$dtexecPath' '/FILE $packagePath /SET \Package.Variables[User::Variable1].Properties[Value];"1
" /SET \Package.Variables[User::Variable2].Properties[ConnectionString];"Data Source=Demo;Initial Catalog=Demo;Integrated Security=SSPI;Auto Translate=True;
" ' "
# Execute the command
Invoke-Expression $command | Out-Null
How can I connect SSMS server with this code it is possible to make connection for one or more server??
Output :-- Initial : The term 'Initial' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.