Code Monkey home page Code Monkey logo

automaticpackagerestoremigrationscript's People

Contributors

adenner avatar asbjornu avatar jv42 avatar omidkrad avatar orecht avatar owen2 avatar patrick-steele avatar ryanspletzer avatar scottaddie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automaticpackagerestoremigrationscript's Issues

The regular expression pattern ... is not valid

I get lots of errors like these if I run the script.

The regular expression pattern \s is not valid.
At C:\Temp\mapsui-temp-build-error\Mapsui\migrateToAutomaticPackageRestore.ps1:36 char:9

  •     $content = $content -replace $badStuff, ""
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (\s<Import Proje...t.targets')" />:String) [], RuntimeException
    • FullyQualifiedErrorId : InvalidRegularExpression

The regular expression pattern \s.nuget\NuGet.exe = .nuget\NuGet.exe
\s*.nuget\NuGet.targets = .nuget\NuGet.targets is not valid.
At C:\Temp\mapsui-temp-build-error\Mapsui\migrateToAutomaticPackageRestore.ps1:36 char:9

  •     $content = $content -replace $badStuff, ""
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (\s.nuget\NuGet....t\NuGet.targets:String) [], RuntimeException
    • FullyQualifiedErrorId : InvalidRegularExpression

The regular expression pattern \s is not valid.
At C:\Temp\mapsui-temp-build-error\Mapsui\migrateToAutomaticPackageRestore.ps1:36 char:9

  •     $content = $content -replace $badStuff, ""
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (\s<Import Proje...t.targets')" />:String) [], RuntimeException

Entry point?

It'd help to leave a note about each script and its purpose, as well as when to run what.

This is a great time saver otherwise!!

RedirectionNotSupported ?

I get the following error when I try to run this...

At migrateToAutomaticPackageRestore.ps1:119 char:13
+ </a>        <a href="/business" class="js-selected-navigation-item nav-item" dat ...
+             ~
The '<' operator is reserved for future use.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:121 char:13
+ </a>        <a href="/explore" class="js-selected-navigation-item nav-item" data ...
+             ~
The '<' operator is reserved for future use.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:123 char:13
+ </a>        <a href="/pricing" class="js-selected-navigation-item nav-item" data ...
+             ~
The '<' operator is reserved for future use.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:125 char:11
+ </a>      </nav>
+           ~
The '<' operator is reserved for future use.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:631 char:225
+ ... hidden" value="&#x2713;" /></div>
+                    ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:662 char:11
+       <li>&copy; 2017 <span title="0.06994s from github-fe148-cp1-prd.iad.github ...
+           ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:662 char:23
+       <li>&copy; 2017 <span title="0.06994s from github-fe148-cp1-prd.iad.github ...
+                       ~
The '<' operator is reserved for future use.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:662 char:29
+       <li>&copy; 2017 <span title="0.06994s from github-fe148-cp1-prd.iad.github ...
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'title="0.06994s from github-fe148-cp1-prd.iad.github.net">GitHub</span>' in expression or statement.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:662 char:100
+ ... ">GitHub</span>, Inc.</li>
+                    ~
Missing argument in parameter list.
At C:\Users\a\Source\Repos\k\migrateToAutomaticPackageRestore.ps1:681 char:12
+     You can't perform that action at this time.
+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: '.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : RedirectionNotSupported

Remove blank lines at the end of project files

Hi.

Thank you for migrateToAutomaticPackageRestore.ps1.

I would like to request that blank lines at the end of project files be removed.

They weren't there before Enabling NuGet Package Restore on the solution, and so they shouldn't be there when running migrateToAutomaticPackageRestore.ps1.

Thank you.

Cant get this work when its using \s

I have tried this script and the removal of $kindaBadStuff doesn't work for me - has anyone else ran into this issue? Do here strings work with \s

vbproj files partially updated

I had to modify the script to work with the .vbproj in a solution I had to migrate. The import for the nuget.targets file was: . I simply added the regex below to the script to handle that situation and added it to the replacement loop

$simpleBadStuff = @"

"@

It could be nice to use an array to hold each replacement expression and loop through each of them for each file.

xUnit.net compatible?

xUnit.net's nuget package adds some package restore junk (maybe?) to the csproj files that it is installed into.

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
</Target>

The migration script removes this block from all csproj files that it touches, but I'm not sure if this is actually desirable? Could it potentially break things like Update-Package when a newer version of xUnit.net becomes available? Maybe MSBuild should fail when the package is not found?

Can I specific to a folder

When I execute this script it is looping all directories, can I limit this to a folder by mentioning some path like "C:\XYZ" find all .csproj and .sln in that folder and do the rest

Solution files are saved using the "UTF-8" encoding which cause issues when re-opening them using the Visual Studio Version Selector

I have Visual Studio 2013 and 2015 installed.

I have a directory that contains Visual Studio 2013 sln files.
When I double-click on the sln files, they open in Visual Studio 2013 without issues.

However, after running migrateToAutomaticPackageRestore.ps1 on that directory, double-clicking on the sln files opens them in Visual Studio 2015.

Files with the extension sln are associated with the "Microsoft Visual Studio Version Selector".

The problem is that the sln files were originally saved using ANSI encoding, but migrateToAutomaticPackageRestore.ps1 changed them to use UTF-8 encoding and this is what caused the issue.

Re-saving the sln files back to ANSI, and then double-clicking them opens in Visual Studio 2013 as expected.

I'm thinking the script should save the files in their original encoding.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.