@@ -24,6 +24,7 @@ func TestGetConfig(t *testing.T) {
2424
2525 expected := config.Config {
2626 Platform : "windows" ,
27+
2728 Image : config.Image {
2829 Name : "example_image" ,
2930 DisplayName : "example image" ,
@@ -33,25 +34,39 @@ func TestGetConfig(t *testing.T) {
3334 Tags : []string {"team:infra" , "env:dev" },
3435 DryRun : false ,
3536 },
37+
3638 Installers : []config.Installer {
3739 {Executable : "powershell" , InstallScript : "Write-Host \" Hello World\" \n " },
3840 {Executable : "powershell" , InstallScript : "echo \" Setting up environment\" \n " },
3941 },
40- Files : []config.File {
41- {Path : `C:\AppStream\Scripts\Start-System.ps1` , Content : "Write-EventLog -LogName Application -Source AppStream -EventID 100 -Message \" System session start\" \n " },
42- {Path : `C:\AppStream\Scripts\Start-User.ps1` , Content : "Write-Host \" User profile initialization\" \n " },
43- {Path : `C:\AppStream\Scripts\End-System.ps1` , Content : "Write-EventLog -LogName Application -Source AppStream -EventID 200 -Message \" System cleanup\" \n " },
44- {Path : `C:\AppStream\Scripts\End-User.ps1` , Content : "Write-Host \" User session cleanup\" \n " },
45- },
4642
4743 Catalogs : []config.CatalogConfig {
4844 {
4945 Name : "Notepad" ,
5046 Path : `C:\Windows\System32\notepad.exe` ,
5147 DisplayName : "Notepad" ,
5248 Parameters : "" ,
53- IconPath : `C:\Windows\System32\notepad.exe` ,
54- WorkingDir : `C:\Windows\System32` ,
49+ IconPath : "" ,
50+ WorkingDir : "" ,
51+ },
52+ },
53+
54+ Files : []config.File {
55+ {
56+ Path : `C:\AppStream\Scripts\Start-System.ps1` ,
57+ Content : "Write-EventLog -LogName Application -Source AppStream -EventID 100 -Message \" System session start\" \n " ,
58+ },
59+ {
60+ Path : `C:\AppStream\Scripts\Start-User.ps1` ,
61+ Content : "Write-Host \" User profile initialization\" \n " ,
62+ },
63+ {
64+ Path : `C:\AppStream\Scripts\End-System.ps1` ,
65+ Content : "Write-EventLog -LogName Application -Source AppStream -EventID 200 -Message \" System cleanup\" \n " ,
66+ },
67+ {
68+ Path : `C:\AppStream\Scripts\End-User.ps1` ,
69+ Content : "Write-Host \" User session cleanup\" \n " ,
5570 },
5671 },
5772
@@ -60,31 +75,32 @@ func TestGetConfig(t *testing.T) {
6075 Executables : []config.Executable {
6176 {
6277 Context : "system" ,
63- Filename : `C:\AppStream\Scripts\Start-System.ps1 ` ,
64- Arguments : "-Init" ,
78+ Filename : `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ` ,
79+ Arguments : "-Init -File C: \\ AppStream \\ Scripts \\ Start-System.ps1 " ,
6580 S3LogEnabled : true ,
6681 },
6782 {
6883 Context : "user" ,
69- Filename : `C:\AppStream\Scripts\Start-User.ps1 ` ,
70- Arguments : "-UserSetup" ,
84+ Filename : `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ` ,
85+ Arguments : "-UserSetup -File C: \\ AppStream \\ Scripts \\ Start-User.ps1 " ,
7186 S3LogEnabled : true ,
7287 },
7388 },
7489 WaitingTime : 60 ,
7590 },
91+
7692 SessionTermination : config.SessionConfig {
7793 Executables : []config.Executable {
7894 {
7995 Context : "system" ,
80- Filename : `C:\AppStream\Scripts\End-System.ps1 ` ,
81- Arguments : "-Cleanup " ,
96+ Filename : `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ` ,
97+ Arguments : "-Init -File C: \\ AppStream \\ Scripts \\ Start-System.ps1 " ,
8298 S3LogEnabled : true ,
8399 },
84100 {
85101 Context : "user" ,
86- Filename : `C:\AppStream\Scripts\End-User.ps1 ` ,
87- Arguments : "-CleanupUser " ,
102+ Filename : `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ` ,
103+ Arguments : "-UserSetup -File C: \\ AppStream \\ Scripts \\ Start-User.ps1 " ,
88104 S3LogEnabled : true ,
89105 },
90106 },
0 commit comments