适用于SQL Server数据库管理的Python与PowerShell概述

本文探讨了在SQL Server数据库管理中,PowerShell和Python两种技术的优劣。PowerShell因其与Windows的深度集成和广泛的自动化能力在Windows环境中受到青睐,而Python则因其通用性和在Linux环境中的良好支持而被广泛使用。随着PowerShell Core的开源和跨平台,两种语言在SQL Server管理中可以互相补充。文章还介绍了如何在Linux上安装和使用PowerShell,以及如何通过PowerShell执行Python脚本。
摘要由CSDN通过智能技术生成

Today, Microsoft claims that Linux runs like a First-Class citizen on Azure, .NET Core has been open-sourced, and has been ported over to Linux, taking PowerShell along. PowerShell runs really well on Ubuntu, CentOS, RedHat Linux, and even Mac OS X. There are Alpha builds available for a few other platforms as well, all available for exploitation under the MIT License on GitHub. “Manage anything, anywhere” is what Microsoft is offering to its customers. Keeping with that, we now have:

如今,微软声称Linux像Azure上的一等公民一样运行,.NET Core已开源,并已随PowerShell一起移植到Linux。 PowerShell在Ubuntu,CentOS,RedHat Linux甚至Mac OS X上都可以很好地运行。Alpha版本也可以在其他平台上使用,并且都可以在GitHub上的MIT许可下使用。 微软为客户提供的服务“随处管理”。 保持不变,我们现在有:

All that is to say, you can perform the same actions or achieve the same level of automation, using either language: PowerShell or Python.

这就是说,您可以使用PowerShell或Python这两种语言来执行相同的操作或达到相同的自动化水平。

Python is better as a general-purpose programming/scripting language. If you also have Linux or other non-Windows boxes to administer, you may also probably prefer Python, even though Microsoft is pushing and assisting third parties in developing PowerShell modules to cover wide areas of technologies. If you are a Windows admin, PowerShell is something you’d probably like more, simply because of its deep integration with Microsoft products.

Python作为通用的编程/脚本语言更好。 如果您还需要管理Linux或其他非Windows机器,则即使Microsoft推动并协助第三方开发涵盖广泛技术领域的PowerShell模块,您也可能更喜欢Python。 如果您是Windows管理员,则可能更喜欢PowerShell,因为它与Microsoft产品的深度集成。

In this article, we’ll describe and discuss both technologies and you can see for yourself, which you may choose.

在本文中,我们将描述和讨论这两种技术,您可以自己选择。

电源外壳 (PowerShell)

In the last decade, since its birth, PowerShell has propelled automation extensively due to several of its qualities such as flexibility, dynamism, remoting capabilities, modularity, etc., not to mention being baked into the operating system.

自从诞生以来的最近十年中,PowerShell凭借其多种品质(例如灵活性,动态性,远程功能,模块化等)大大推动了自动化,更不用说将其嵌入操作系统中了。

The available packages lead to easier administration and automation of several repetitive tasks on Windows systems, along with almost all other Microsoft products. Needless to say, many third-party providers such as Citrix and VMware have also created PowerShell modules and snap-ins that administrators can leverage in order to achieve automation. SQL Server is one of the greatest benefactors of PowerShell, having several database management and automation capabilities built in. Ever since PowerShell, we’ve found it a lot easier to load the related modules and invoke the respective cmdlets to take care of several day-to-day activities, starting from simple querying to complex maintenance.

可用的软件包使Windows系统以及几乎所有其他Microsoft产品的管理和自动化工作变得更加轻松。 不用说,Citrix和VMware等许多第三方提供商也创建了PowerShell模块和管理单元,管理员可以利用它们来实现自动化。 SQL Server是PowerShell的最大受益者之一,它内置了多种数据库管理和自动化功能。自PowerShell以来,我们发现加载相关模块并调用各自的cmdlet可以轻松完成数天的工作,日常活动,从简单的查询到复杂的维护。

PowerShell is the prime candidate when it comes to scripting and automation in the world for Windows systems based on one of the main benefits of PowerShell, which is the deep integration with Windows APIs, and it general extensibility. The flexibility of PowerShell addresses most of the challenges we’ve had for several years in managing Windows systems. Today, PowerShell is available for Linux and Bash for Windows (with Linux Subsystem for Windows). According to me, it helps both Windows as well as Linux administrators go cross-platform. Perhaps, someday, we may be able to use both the systems as if they were one.

基于PowerShell的主要优势之一(与Windows API的深度集成以及它的一般可扩展性),PowerShell是Windows系统的脚本和自动化领域的主要候选者。 PowerShell的灵活性解决了我们多年来管理Windows系统所面临的大多数挑战。 今天,PowerShell适用于Linux和Bash for Windows(带有Windows的Linux子系统)。 据我介绍,它可以帮助Windows和Linux管理员跨平台使用。 也许有一天,我

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值