How to replace a string in file on remote computer in Powershell?












0















I have a VM running Windows Server 2012.And some intended services on it. I want to change a configuration file on this VM machine remotely from my desktop pc.
Currently I change this configuration file by mapping the C: drive of the remote server and then changing the file. Now this blocks me from changing multiple servers as I can't map multiple server c: simultaneously to same drive. Also, mapping hundreds of drives wouldn't be ideal.
The way I am changing the file by mapping drive is:



$password = <password text> | ConvertTo-SecureString -asPlainText -Force
$username = "admin"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'

(Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
type 'z:Program FileslalalandDataSettings.xml'
net use z: /delete


Therefore I searched for a better option and found this script at https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Replace-String-58fbfa85 but it doesn't work for me.



I am using this script as :



.Replace-StringInFile.ps1 -ComputerName  <RemoteComputerHostName> -TargetPath 'C:Program FileslalalandData' -Fil


eName Settings.xml -Replace $oldString -ReplaceWith $newString -Credential (Get-Credential)



when I run the command credential window pops up asking for username and password. I enter the username and password that I used for mapping the drive, but it throws the following error:



New-PSSession : [<RemoteHostName>] Connecting to remote server <RemoteHostName> failed with the following error message : The user name or password is incorrect. For more information, see the
about_Remote_Troubleshooting Help topic.
At D:workspaceReplace-StringInFile.ps1:84 char:14
+ ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed


what I don't understand is when I map the drive with the same credentials it works fine but using the other script, which internally uses New-PSSession doesn't work.



Any idea ?










share|improve this question




















  • 4





    Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

    – Bill_Stewart
    Nov 19 '18 at 22:51











  • you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

    – Lee_Dailey
    Nov 19 '18 at 22:57











  • Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

    – Scepticalist
    Nov 20 '18 at 7:55
















0















I have a VM running Windows Server 2012.And some intended services on it. I want to change a configuration file on this VM machine remotely from my desktop pc.
Currently I change this configuration file by mapping the C: drive of the remote server and then changing the file. Now this blocks me from changing multiple servers as I can't map multiple server c: simultaneously to same drive. Also, mapping hundreds of drives wouldn't be ideal.
The way I am changing the file by mapping drive is:



$password = <password text> | ConvertTo-SecureString -asPlainText -Force
$username = "admin"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'

(Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
type 'z:Program FileslalalandDataSettings.xml'
net use z: /delete


Therefore I searched for a better option and found this script at https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Replace-String-58fbfa85 but it doesn't work for me.



I am using this script as :



.Replace-StringInFile.ps1 -ComputerName  <RemoteComputerHostName> -TargetPath 'C:Program FileslalalandData' -Fil


eName Settings.xml -Replace $oldString -ReplaceWith $newString -Credential (Get-Credential)



when I run the command credential window pops up asking for username and password. I enter the username and password that I used for mapping the drive, but it throws the following error:



New-PSSession : [<RemoteHostName>] Connecting to remote server <RemoteHostName> failed with the following error message : The user name or password is incorrect. For more information, see the
about_Remote_Troubleshooting Help topic.
At D:workspaceReplace-StringInFile.ps1:84 char:14
+ ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed


what I don't understand is when I map the drive with the same credentials it works fine but using the other script, which internally uses New-PSSession doesn't work.



Any idea ?










share|improve this question




















  • 4





    Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

    – Bill_Stewart
    Nov 19 '18 at 22:51











  • you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

    – Lee_Dailey
    Nov 19 '18 at 22:57











  • Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

    – Scepticalist
    Nov 20 '18 at 7:55














0












0








0








I have a VM running Windows Server 2012.And some intended services on it. I want to change a configuration file on this VM machine remotely from my desktop pc.
Currently I change this configuration file by mapping the C: drive of the remote server and then changing the file. Now this blocks me from changing multiple servers as I can't map multiple server c: simultaneously to same drive. Also, mapping hundreds of drives wouldn't be ideal.
The way I am changing the file by mapping drive is:



$password = <password text> | ConvertTo-SecureString -asPlainText -Force
$username = "admin"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'

(Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
type 'z:Program FileslalalandDataSettings.xml'
net use z: /delete


Therefore I searched for a better option and found this script at https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Replace-String-58fbfa85 but it doesn't work for me.



I am using this script as :



.Replace-StringInFile.ps1 -ComputerName  <RemoteComputerHostName> -TargetPath 'C:Program FileslalalandData' -Fil


eName Settings.xml -Replace $oldString -ReplaceWith $newString -Credential (Get-Credential)



when I run the command credential window pops up asking for username and password. I enter the username and password that I used for mapping the drive, but it throws the following error:



New-PSSession : [<RemoteHostName>] Connecting to remote server <RemoteHostName> failed with the following error message : The user name or password is incorrect. For more information, see the
about_Remote_Troubleshooting Help topic.
At D:workspaceReplace-StringInFile.ps1:84 char:14
+ ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed


what I don't understand is when I map the drive with the same credentials it works fine but using the other script, which internally uses New-PSSession doesn't work.



Any idea ?










share|improve this question
















I have a VM running Windows Server 2012.And some intended services on it. I want to change a configuration file on this VM machine remotely from my desktop pc.
Currently I change this configuration file by mapping the C: drive of the remote server and then changing the file. Now this blocks me from changing multiple servers as I can't map multiple server c: simultaneously to same drive. Also, mapping hundreds of drives wouldn't be ideal.
The way I am changing the file by mapping drive is:



$password = <password text> | ConvertTo-SecureString -asPlainText -Force
$username = "admin"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
net use Z: \$ipAddressC$ <password> /user:admin type 'z:Program FileslalalandDataSettings.xml'

(Get-Content 'z:Program FileslalalandDataSettings.xml') | ForEach-Object { $_ -replace $oldString, $newString } | Set-Content 'z:Program FileslalalandDataSettings.xml'
type 'z:Program FileslalalandDataSettings.xml'
net use z: /delete


Therefore I searched for a better option and found this script at https://gallery.technet.microsoft.com/scriptcenter/PowerShell-Replace-String-58fbfa85 but it doesn't work for me.



I am using this script as :



.Replace-StringInFile.ps1 -ComputerName  <RemoteComputerHostName> -TargetPath 'C:Program FileslalalandData' -Fil


eName Settings.xml -Replace $oldString -ReplaceWith $newString -Credential (Get-Credential)



when I run the command credential window pops up asking for username and password. I enter the username and password that I used for mapping the drive, but it throws the following error:



New-PSSession : [<RemoteHostName>] Connecting to remote server <RemoteHostName> failed with the following error message : The user name or password is incorrect. For more information, see the
about_Remote_Troubleshooting Help topic.
At D:workspaceReplace-StringInFile.ps1:84 char:14
+ ... $Session = New-PSSession -ComputerName $Computer -Credential $Creden ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed


what I don't understand is when I map the drive with the same credentials it works fine but using the other script, which internally uses New-PSSession doesn't work.



Any idea ?







powershell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 8:07







Monku

















asked Nov 19 '18 at 22:48









MonkuMonku

68011121




68011121








  • 4





    Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

    – Bill_Stewart
    Nov 19 '18 at 22:51











  • you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

    – Lee_Dailey
    Nov 19 '18 at 22:57











  • Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

    – Scepticalist
    Nov 20 '18 at 7:55














  • 4





    Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

    – Bill_Stewart
    Nov 19 '18 at 22:51











  • you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

    – Lee_Dailey
    Nov 19 '18 at 22:57











  • Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

    – Scepticalist
    Nov 20 '18 at 7:55








4




4





Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

– Bill_Stewart
Nov 19 '18 at 22:51





Editing the file via UNC path name (presuming administrator privilege, etc.) is by far the easist way.

– Bill_Stewart
Nov 19 '18 at 22:51













you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

– Lee_Dailey
Nov 19 '18 at 22:57





you can create multiple powershell jobs that run your "one computer" version against each remote system. if that script has no problems running as you, then the jobs will have no problem. [grin] ///// i would likely use Invoke-Command to run the code on each system. that would save sending the file from the source to your system & then sending it back. the Invoke-Command cmdlet can accept a list of system names in the -ComputerName parameter. take a look at Get-Help Invoke-Command for more details.

– Lee_Dailey
Nov 19 '18 at 22:57













Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

– Scepticalist
Nov 20 '18 at 7:55





Are the remote endpoints enabled for PSremoting? Anyway, is there a reason you aren't just using the admin share and UNC paths e.g.Get-Content '\$ipaddressc$Program FileslalalandDataSettings.xml'

– Scepticalist
Nov 20 '18 at 7:55












1 Answer
1






active

oldest

votes


















0














I was able to do this using the following cmdlet:



function Edit-RemoteFileStringReplace
{
[cmdletbinding()]
param([Parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$Address,
[Parameter(Mandatory=$true)][string]$FilePath,
[Parameter(Mandatory=$true)][string]$Replace,
[Parameter(Mandatory=$true)][string]$ReplaceWith,
[Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$Credential
)

$DriveLetter=""
$FilePathWithoutDriveLetter=""

$DriveName = $Address.replace('.','x')
$DriveName = "PSDrive_$DriveName"

$DriveLetter = (Get-DriveLetterFromPath -Path $FilePath).Substring(0,1)
$FilePathWithoutDriveLetter = Remove-DriveLetterFromPath -Path $FilePath
$MappedFilePath="$DriveName" + ":$FilePathWithoutDriveLetter"

New-PSDrive -Name $DriveName -PSProvider FileSystem -Root \$Address$DriveLetter$ -Credential $Credential -ErrorAction Stop
(Get-Content $MappedFilePath) | ForEach-Object { $_ -replace $Replace, $ReplaceWith } | Set-Content $MappedFilePath
Remove-PSDrive -Name $DriveName
}





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383760%2fhow-to-replace-a-string-in-file-on-remote-computer-in-powershell%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I was able to do this using the following cmdlet:



    function Edit-RemoteFileStringReplace
    {
    [cmdletbinding()]
    param([Parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$Address,
    [Parameter(Mandatory=$true)][string]$FilePath,
    [Parameter(Mandatory=$true)][string]$Replace,
    [Parameter(Mandatory=$true)][string]$ReplaceWith,
    [Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$Credential
    )

    $DriveLetter=""
    $FilePathWithoutDriveLetter=""

    $DriveName = $Address.replace('.','x')
    $DriveName = "PSDrive_$DriveName"

    $DriveLetter = (Get-DriveLetterFromPath -Path $FilePath).Substring(0,1)
    $FilePathWithoutDriveLetter = Remove-DriveLetterFromPath -Path $FilePath
    $MappedFilePath="$DriveName" + ":$FilePathWithoutDriveLetter"

    New-PSDrive -Name $DriveName -PSProvider FileSystem -Root \$Address$DriveLetter$ -Credential $Credential -ErrorAction Stop
    (Get-Content $MappedFilePath) | ForEach-Object { $_ -replace $Replace, $ReplaceWith } | Set-Content $MappedFilePath
    Remove-PSDrive -Name $DriveName
    }





    share|improve this answer




























      0














      I was able to do this using the following cmdlet:



      function Edit-RemoteFileStringReplace
      {
      [cmdletbinding()]
      param([Parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$Address,
      [Parameter(Mandatory=$true)][string]$FilePath,
      [Parameter(Mandatory=$true)][string]$Replace,
      [Parameter(Mandatory=$true)][string]$ReplaceWith,
      [Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$Credential
      )

      $DriveLetter=""
      $FilePathWithoutDriveLetter=""

      $DriveName = $Address.replace('.','x')
      $DriveName = "PSDrive_$DriveName"

      $DriveLetter = (Get-DriveLetterFromPath -Path $FilePath).Substring(0,1)
      $FilePathWithoutDriveLetter = Remove-DriveLetterFromPath -Path $FilePath
      $MappedFilePath="$DriveName" + ":$FilePathWithoutDriveLetter"

      New-PSDrive -Name $DriveName -PSProvider FileSystem -Root \$Address$DriveLetter$ -Credential $Credential -ErrorAction Stop
      (Get-Content $MappedFilePath) | ForEach-Object { $_ -replace $Replace, $ReplaceWith } | Set-Content $MappedFilePath
      Remove-PSDrive -Name $DriveName
      }





      share|improve this answer


























        0












        0








        0







        I was able to do this using the following cmdlet:



        function Edit-RemoteFileStringReplace
        {
        [cmdletbinding()]
        param([Parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$Address,
        [Parameter(Mandatory=$true)][string]$FilePath,
        [Parameter(Mandatory=$true)][string]$Replace,
        [Parameter(Mandatory=$true)][string]$ReplaceWith,
        [Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$Credential
        )

        $DriveLetter=""
        $FilePathWithoutDriveLetter=""

        $DriveName = $Address.replace('.','x')
        $DriveName = "PSDrive_$DriveName"

        $DriveLetter = (Get-DriveLetterFromPath -Path $FilePath).Substring(0,1)
        $FilePathWithoutDriveLetter = Remove-DriveLetterFromPath -Path $FilePath
        $MappedFilePath="$DriveName" + ":$FilePathWithoutDriveLetter"

        New-PSDrive -Name $DriveName -PSProvider FileSystem -Root \$Address$DriveLetter$ -Credential $Credential -ErrorAction Stop
        (Get-Content $MappedFilePath) | ForEach-Object { $_ -replace $Replace, $ReplaceWith } | Set-Content $MappedFilePath
        Remove-PSDrive -Name $DriveName
        }





        share|improve this answer













        I was able to do this using the following cmdlet:



        function Edit-RemoteFileStringReplace
        {
        [cmdletbinding()]
        param([Parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$Address,
        [Parameter(Mandatory=$true)][string]$FilePath,
        [Parameter(Mandatory=$true)][string]$Replace,
        [Parameter(Mandatory=$true)][string]$ReplaceWith,
        [Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$Credential
        )

        $DriveLetter=""
        $FilePathWithoutDriveLetter=""

        $DriveName = $Address.replace('.','x')
        $DriveName = "PSDrive_$DriveName"

        $DriveLetter = (Get-DriveLetterFromPath -Path $FilePath).Substring(0,1)
        $FilePathWithoutDriveLetter = Remove-DriveLetterFromPath -Path $FilePath
        $MappedFilePath="$DriveName" + ":$FilePathWithoutDriveLetter"

        New-PSDrive -Name $DriveName -PSProvider FileSystem -Root \$Address$DriveLetter$ -Credential $Credential -ErrorAction Stop
        (Get-Content $MappedFilePath) | ForEach-Object { $_ -replace $Replace, $ReplaceWith } | Set-Content $MappedFilePath
        Remove-PSDrive -Name $DriveName
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 5 '18 at 18:31









        MonkuMonku

        68011121




        68011121






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53383760%2fhow-to-replace-a-string-in-file-on-remote-computer-in-powershell%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith