Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
majkinetor committed Sep 21, 2017
1 parent 5c427a4 commit 0667c76
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ function global:au_AfterUpdate ($Package) {
To extract descriptions from existing packages into README.md files the following script can be used:

```powershell
. $Env:ProgramFiles\WindowsPowerShell\Modules\AU\Private\AUPackage.ps1
ls | ? PSIsContainer | ? { !(Test-Path $_\Readme.md) } | % {
$package = New-Object AUPackage (Resolve-Path $_)
$readme = @('# <img src="{1}" width="48" height="48"/> [{0}](https://chocolatey.org/packages/{0})' -f $package.Name, $package.iconUrl, '')
$readme += $package.NuspecXml.package.metadata.description -split "`n" | % { $_.Trim() }
$readme -join "`n" | Out-File $_\README.md
ls | ? PSIsContainer | ? { !(Test-Path $_\README.md) | % {
[xml] $package = gc $_\*.nuspec
$meta = $package.package.metadata
$readme = ('# <img src="{1}" width="48" height="48"/> [{0}](https://chocolatey.org/packages/{0})' -f $meta.id, $meta.iconUrl), ''
$readme += $meta.description -split "`n" | % { $_.Trim() }
$readme -join "`n" | Out-File -Encoding UTF8 $_\README.md
$meta.id
}
```

Expand Down

0 comments on commit 0667c76

Please sign in to comment.