Automating VS Signup and workspace mapping via script on non-persistent VM

Matteo Mario Cossu 21 Reputation points
2022-10-03T10:13:15.913+00:00

My developement environment is a client provided non-persistent Win10 virtual machine with a VS2019 pre-install image.
Every day:

  • i have to Sign in to VS with my corporation credentials (with MFA) in order to use the IDE
  • i have to add a server to the DevOps list under Team Explorer
  • i have to map a specific workspace between many, in this server
  • i have to map and get the latest revision for a specific project between many, from this workspace

I wish to automate this process with some powershell script, throught some access token, maybe, for the sign in part.
Is it possible? is there a way to access the functionalities above via command line?

Developer technologies | Visual Studio | Setup
Windows for business | Windows Server | User experience | PowerShell
Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,451 Reputation points Microsoft External Staff
    2022-10-04T03:36:56.307+00:00

    Hi @Matteo Mario Cossu ,

    Welcome to Microsoft Q&A forum.

    From VS side, Visual Studio provides some commands(see following links), but auto sign in(I believe MFA has some limitations for sign-in), auto connect to DevOps, auto map something are too customized. Simple VS commands don’t meet your requirements.

    Devenv command-line switches

    Visual Studio commands

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Limitless Technology 39,931 Reputation points
    2022-10-06T07:51:57.453+00:00

    Hi,

    Thank you for posting your query.

    Kindly follow the steps provided below to resolve your issue.

    1. Steps to replicate:

    Create an object level automation script using the following

    Object Level Launch Point

    Launch Point = OBJ-ASSET-STATUS
    Description = Object Asset Status History
    Object = ASCHANGESTATUS
    Active = Y
    Add = Y
    update = Y
    Initialize = N
    Delete = N

    No required variables.

    Script = OBJ-ASSET-STATUS-SCRIPT
    Description = Object asset status history
    Log Level = DEBUG
    Status = Active
    language = jython

    Script should be like below :

    from psdi.util.logging import MXLogger
    from psdi.util.logging import MXLoggerFactory
    from psdi.mbo import MboConstants
    from java.util import Date
    logger = MXLoggerFactory.getLogger("maximo.script");
    logger.debug("==OBJ-ASSET-STATUS-SCRIPT." + launchPoint + ": START ==")
    assetnum = mbo.getOwner().getString("assetnum");
    logger.debug("==OBJ-ASSET-MSM-SCRIPT.assetnum=="+ assetnum)
    logger.debug("==OBJ-ASSET-STATUS-SCRIPT." + launchPoint + ": END ==")

    Go to this link for your reference https://www.ibm.com/support/pages/automation-scripts-and-non-persistent-objects

    Note: This is a non-Microsoft website kindly take precautions before downloading anything.

    Do not hesitate to message us if you need further assistance.

    ---------------------------------------------------------------------------------------------------------------------------------------------

    If the answer is helpful kindly click "Accept as Answer" and upvote it. Thanks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.