| 
									
										
										
										
											2019-10-08 14:25:33 +08:00
										 |  |  | function Set-FileConfiguration { | 
					
						
							|  |  |  |     param( | 
					
						
							|  |  |  |         [string]$filePath | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2019-08-18 22:49:44 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-08 14:38:17 +08:00
										 |  |  |     $replace = "<DebugInformationFormat>(EditAndContinue|ProgramDatabase)</DebugInformationFormat>" | 
					
						
							| 
									
										
										
										
											2019-10-08 14:25:33 +08:00
										 |  |  |     $replaceTo = "<DebugInformationFormat>None</DebugInformationFormat>" | 
					
						
							| 
									
										
										
										
											2019-08-20 14:55:36 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Create a copy of .vcxproj file | 
					
						
							| 
									
										
										
										
											2019-08-18 22:49:44 +08:00
										 |  |  |     Copy-Item -Path $filePath -Destination ($filePath + '.template') | 
					
						
							| 
									
										
										
										
											2019-08-20 14:55:36 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Overlay some configurations | 
					
						
							| 
									
										
										
										
											2019-10-08 14:38:17 +08:00
										 |  |  |     Get-Content ($filePath + '.template') -Encoding UTF8 | ForEach-Object { $_ -replace $replace, $replaceTo } | Out-File $filePath -Encoding UTF8 | 
					
						
							| 
									
										
										
										
											2019-08-20 14:55:36 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Delete the copy file | 
					
						
							| 
									
										
										
										
											2019-08-18 23:19:51 +08:00
										 |  |  |     Remove-Item -Path ($filePath + '.template') | 
					
						
							| 
									
										
										
										
											2019-08-18 22:49:44 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2019-10-08 14:25:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | Get-ChildItem -Path 'projects\' -Directory | ForEach-Object { | 
					
						
							|  |  |  |     $dirPath = "projects\$($_)" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Search all vcxproj files | 
					
						
							|  |  |  |     Get-ChildItem -Path $dirPath *.vcxproj -File | ForEach-Object { | 
					
						
							| 
									
										
										
										
											2019-10-08 14:38:17 +08:00
										 |  |  |         Set-FileConfiguration ($dirPath + '\' + $_) | 
					
						
							| 
									
										
										
										
											2019-10-08 14:25:33 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | } |