Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:20:24+00:00 2026-06-12T23:20:24+00:00

I have a large library of existing powershell scripts, primarily to run some complicated

  • 0

I have a large library of existing powershell scripts, primarily to run some complicated logic and interactions between SQL Server and the file system.

The SQL interactions typically are performed through the cmdlet Invoke-SQLCmd.

Recently the SSMS version on all of my servers was upgraded to 2012. This meant I had to make some changes to my code to remove references to the sqlserverprovidersnapin100 and sqlservercmdletsnapin100 since those are deprecated in 2012 in favor of importing the SQLPs module.

This has worked OK, but it seems that the SQLPs module is at some point changing the current location to PS SQLSERVER> instead of <local folder>, which makes a lot of my other commands fail. For instance, if I run a Test-Path on a network drive, it works fine from the <local folder> location but will fail from the SQLSERVER location.

Is this a known issue? Is there a workaround or setting I can change for this?

The main script I am worried about is over 1000 lines and has run with no issues for over two years until we made this change, so I’d like to avoid doing a line by line test of it if I can.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:20:25+00:00Added an answer on June 12, 2026 at 11:20 pm

    I’ve solved this problem by adding a cd <local folder> as the first line of the script to break out of the provider.
    Feels hackish though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have started using the boost unit testing library for a large existing code
I am writing a fairly large C++ shared-object library, and have run into a
Consider I have large library package with sophisticated tree of private or package modules
I have a large library of code which has a few (much too few)
I have a large sprite library and I'd like to cut GPU memory requirements.
I have a project which uses a large library residing in its own repository.
I am developing a fairly large C++ support library, and have found myself moving
I have a large music library which I have just spent around 30 hours
We have a large library that makes a lot of HTTP calls using HttpWebRequest
I have fairly large C++ library with several sub-libraries that support it, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.