I try to simply call my script by using the System.Diagnostics.Process.Start
command, but when powershell appears I have a sort of crash. I tried to use this command with other scripts and it was working.
I give you the entire line :
System.Diagnostics.Process.Start("powershell.exe", @"..\..\script\rolesAndFeatures");
and my script:
function rolesAndFeatures{
param(
[parameter(mandatory)]
[string[]] $computerNames
)
foreach($computerName in $computerNames) {
Install-WindowsFeature FileAndStorage-Services , Storage-Services , Web-Server , Web-WebServer , Web-Default-Doc , Web-Dir-Browsing , Web-Http-Errors , Web-Static-Content , Web-Health , Web-Http-Logging , Web-ODBC-Logging , Web-Performance , Web-Stat-Compression , Web-Security , Web-Filtering , Web-Basic-Auth , Web-App-Dev , Web-Net-Ext , Web-Net-Ext45 , Web-Asp-Net , Web-Asp-Net45 , Web-ISAPI-Ext , Web-ISAPI-Filter , Web-Mgmt-Tools , Web-Mgmt-Console , Web-Mgmt-Compat , Web-Metabase , Web-Lgcy-Mgmt-Console , Web-WMI , NET-Framework-Features , NET-Framework-Core , NET-HTTP-Activation , NET-Framework-45-Features , NET-Framework-45-Core , NET-Framework-45-ASPNET , NET-WCF-Services45 , NET-WCF-HTTP-Activation45 , NET-WCF-TCP-PortSharing45 , RSAT , RSAT-Feature-Tools , RSAT-SMTP , RSAT-Role-Tools , RSAT-AD-Tools , RSAT-AD-PowerShell , RSAT-ADDS , RSAT-AD-AdminCenter , RSAT-ADDS-Tools , RSAT-ADLDS , RSAT-Hyper-V-Tools , Hyper-V-Tools , Hyper-V-PowerShell , RSAT-RDS-Tools , UpdateServices-RSAT , UpdateServices-API , UpdateServices-API, UpdateServices-UI , SMTP-Server , System-DataArchiver , Windows-Defender , PowerShellRoot , PowerShell , PowerShell-V2 , PowerShell-ISE , WAS , WAS-Process-Model , WAS-NET-Environment , WAS-Config-APIs , WoW64-Support , XPS-Viewer -restart
}
}
rolesAndFeatures
I don't understand why, hope you can help me thank you guys.