-
-
Notifications
You must be signed in to change notification settings - Fork 7
Add ProjectBuildEvent
Apostolis Bekiaris edited this page Apr 22, 2020
·
1 revision
Adds MSBuild project build PostBuildEvent, PreBuildEvent.
Add-ProjectBuildEvent [-EventName] <String> [-Project] <XmlDocument> [-InnerText] <String> [-Append]
[<CommonParameters>]
Adds MSBuild project build PostBuildEvent, PreBuildEvent.
PS C:\> $linkText=@"
if exist `"`$(MSBuildProjectDirectory)\bin`" rmdir `"`$(MSBuildProjectDirectory)\bin`"
mklink /J `"`$(MSBuildProjectDirectory)\bin" "`$(MSBuildProjectDirectory)\`$(OutputPath)`"
"@
$postBuildEvent=$CSProj.project.PropertyGroup.PostBuildEvent|Where-Object{$_}
if (($postBuildEvent|Where-Object{
$_ -notlike "*nmklink*"
})){
Add-ProjectBuildEvent PostBuildEvent $CSProj -InnerText $linkText -Append
}
Creates a junction pointing to the MSBuild project output path. Used from the Update-OutputPath CmdLet.
{{ Fill Append Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill EventName Description }}
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: PostBuildEvent, PreBuildEvent
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill InnerText Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill Project Description }}
Type: XmlDocument
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.